diff options
author | Martin Hunt <hunt@redhat.com> | 2001-03-15 18:02:14 +0000 |
---|---|---|
committer | Martin Hunt <hunt@redhat.com> | 2001-03-15 18:02:14 +0000 |
commit | 77cd5909d221ee132e3973b74f668abe098a1616 (patch) | |
tree | 5baf91ebbc262aeb7acc6b4a5536209dbc4edfff /gdb/linespec.c | |
parent | f7f5a202bcb4ae351a70ca1f0ba1e87106f0ac82 (diff) | |
download | gdb-77cd5909d221ee132e3973b74f668abe098a1616.zip gdb-77cd5909d221ee132e3973b74f668abe098a1616.tar.gz gdb-77cd5909d221ee132e3973b74f668abe098a1616.tar.bz2 |
2001-03-15 Martin Hunt <hunt@redhat.com>
* linespec.c (decode_line_1): Remove trailing quote
when parsing double quotes.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r-- | gdb/linespec.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index 3f790cc..d70d634 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -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'; |