From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24020 invoked by alias); 18 Nov 2002 17:14:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24007 invoked from network); 18 Nov 2002 17:14:55 -0000 Received: from unknown (HELO mx09.cluster1.charter.net) (209.225.8.19) by sources.redhat.com with SMTP; 18 Nov 2002 17:14:55 -0000 Received: from [66.189.46.2] (HELO platinum.local.) by mx09.cluster1.charter.net (CommuniGate Pro SMTP 3.5.9) with ESMTP id 28814139; Mon, 18 Nov 2002 12:14:54 -0500 Date: Mon, 18 Nov 2002 09:14:00 -0000 Subject: Re: [PATCH] skip_quoted (updated) Content-Type: multipart/mixed; boundary=Apple-Mail-2--797050075 Mime-Version: 1.0 (Apple Message framework v543) Cc: gdb-patches@sources.redhat.com To: Adam Fedor From: Klee Dienes In-Reply-To: <3DD90559.1070202@doc.com> Message-Id: <3FFE7016-FB19-11D6-84AF-00039396EEB8@apple.com> X-SW-Source: 2002-11/txt/msg00460.txt.bz2 --Apple-Mail-2--797050075 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 222 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: --Apple-Mail-2--797050075 Content-Disposition: attachment; filename=skip-quoted.txt Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="skip-quoted.txt" Content-length: 1439 --- /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) */ --Apple-Mail-2--797050075 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 1 --Apple-Mail-2--797050075--