]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2001-03-15 Martin Hunt <hunt@redhat.com>
authorMartin Hunt <hunt@redhat.com>
Thu, 15 Mar 2001 18:02:14 +0000 (18:02 +0000)
committerMartin Hunt <hunt@redhat.com>
Thu, 15 Mar 2001 18:02:14 +0000 (18:02 +0000)
* linespec.c (decode_line_1): Remove trailing quote
when parsing double quotes.

gdb/ChangeLog
gdb/linespec.c

index 94d31940c3f352551547ee8aa7a6c707890c70c9..8f2cbd2a10ebf9e5f8d6bdb0581e53dd76d1dd35 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-15  Martin Hunt  <hunt@redhat.com>
+
+       * linespec.c (decode_line_1): Remove trailing quote
+       when parsing double quotes.
+
 2001-03-15  Kevin Buettner  <kevinb@redhat.com>
 
        * uw-thread.c (read_thr_debug, read_map, read_lwp, thread_iter)
index 3f790cc49c43820edb4835dd9b5d3f3877ebcc30..d70d63426db86d71a3dd70c5ded5f69c63a0f566 100644 (file)
@@ -1,6 +1,6 @@
 /* Parser for linespec for the GNU debugger, GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000
+   1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -612,10 +612,11 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
 
   s = NULL;
   p = *argptr;
-  if (**argptr == '"')
+  if (p[0] == '"')
     {
       is_quote_enclosed = 1;
       (*argptr)++;
+      p++;
     }
   else
     is_quote_enclosed = 0;
@@ -654,7 +655,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
   /* if the closing double quote was left at the end, remove it */
   if (is_quote_enclosed)
     {
-      char *closing_quote = strchr (p, '"');
+      char *closing_quote = strchr (p - 1, '"');
       if (closing_quote && closing_quote[1] == '\0')
        *closing_quote = '\0';
     }
@@ -1092,9 +1093,6 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
       p = skip_quoted (*argptr);
     }
 
-  if (is_quote_enclosed && **argptr == '"')
-    (*argptr)++;
-
   copy = (char *) alloca (p - *argptr + 1);
   memcpy (copy, *argptr, p - *argptr);
   copy[p - *argptr] = '\0';