From: Klee Dienes <klee@apple.com>
To: Adam Fedor <fedor@doc.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] skip_quoted (updated)
Date: Mon, 18 Nov 2002 09:14:00 -0000 [thread overview]
Message-ID: <3FFE7016-FB19-11D6-84AF-00039396EEB8@apple.com> (raw)
In-Reply-To: <3DD90559.1070202@doc.com>
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
It must be a good name for the function, because we picked the same one
at Apple.
You might also consider using our patch, which has the advantage of not
replicating the code between skip_quoted and skip_quoted_chars:
[-- Attachment #2: skip-quoted.txt --]
[-- Type: text/plain, Size: 1439 bytes --]
--- /Volumes/Storage/Users/kdienes/source/cygnus.cygnus/src/gdb/completer.c Sat Nov 16 12:52:18 2002
+++ completer.c Thu Nov 14 14:53:54 2002
@@ -683,11 +687,17 @@
location after the "word". */
char *
-skip_quoted (char *str)
+skip_quoted_chars (char *str, char *quotechars, char *breakchars)
{
char quote_char = '\0';
char *scan;
+ if (quotechars == NULL)
+ quotechars = gdb_completer_quote_characters;
+
+ if (breakchars == NULL)
+ breakchars = gdb_completer_word_break_characters;
+
for (scan = str; *scan != '\0'; scan++)
{
if (quote_char != '\0')
@@ -700,16 +710,23 @@
break;
}
}
- else if (strchr (gdb_completer_quote_characters, *scan))
+ else if (strchr (quotechars, *scan))
{
/* Found start of a quoted string. */
quote_char = *scan;
}
- else if (strchr (gdb_completer_word_break_characters, *scan))
+ else if (strchr (breakchars, *scan))
{
break;
}
}
+
return (scan);
+}
+
+char *
+skip_quoted (char *str)
+{
+ return skip_quoted_chars (str, NULL, NULL);
}
--- /Volumes/Storage/Users/kdienes/source/cygnus.cygnus/src/gdb/completer.h Sat Nov 16 12:52:18 2002
+++ completer.h Thu Nov 14 14:53:54 2002
@@ -37,7 +37,8 @@
/* Exported to linespec.c */
-extern char *skip_quoted (char *str);
+extern char *skip_quoted_chars (char *, char *, char *);
+extern char *skip_quoted (char *);
#endif /* defined (COMPLETER_H) */
[-- Attachment #3: Type: text/plain, Size: 1 bytes --]
next prev parent reply other threads:[~2002-11-18 17:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-18 7:20 Adam Fedor
2002-11-18 9:14 ` Klee Dienes [this message]
2002-11-18 18:39 ` Jim Blandy
2002-11-18 19:03 ` Adam Fedor
2002-11-20 1:12 ` Klee Dienes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3FFE7016-FB19-11D6-84AF-00039396EEB8@apple.com \
--to=klee@apple.com \
--cc=fedor@doc.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox