aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-05-10 20:05:27 +0000
committerDaniel Jacobowitz <drow@false.org>2002-05-10 20:05:27 +0000
commit2654e6d432835d6402a57b64323d49cf699048b9 (patch)
treed028c2ebb89d2df753ec309f306f23e20fc385d7 /gdb/linespec.c
parentc4b7bc2bea4cf67926e48f3c32f297d2f17c04fa (diff)
downloadgdb-2654e6d432835d6402a57b64323d49cf699048b9.zip
gdb-2654e6d432835d6402a57b64323d49cf699048b9.tar.gz
gdb-2654e6d432835d6402a57b64323d49cf699048b9.tar.bz2
2002-05-10 Daniel Jacobowitz <drow@mvista.com>
* linespec.c (decode_line_1): Check for a double quote after a filename correctly.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index b9a772c..f707234 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -931,20 +931,12 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
if ((*p == '"') && is_quote_enclosed)
--p;
copy = (char *) alloca (p - *argptr + 1);
- if ((**argptr == '"') && is_quote_enclosed)
- {
- memcpy (copy, *argptr + 1, p - *argptr - 1);
- /* It may have the ending quote right after the file name */
- if (copy[p - *argptr - 2] == '"')
- copy[p - *argptr - 2] = 0;
- else
- copy[p - *argptr - 1] = 0;
- }
+ memcpy (copy, *argptr, p - *argptr);
+ /* It may have the ending quote right after the file name */
+ if (is_quote_enclosed && copy[p - *argptr - 1] == '"')
+ copy[p - *argptr - 1] = 0;
else
- {
- memcpy (copy, *argptr, p - *argptr);
- copy[p - *argptr] = 0;
- }
+ copy[p - *argptr] = 0;
/* Find that file's data. */
s = lookup_symtab (copy);