diff options
author | Keith Seitz <keiths@redhat.com> | 2012-07-26 16:22:48 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2012-07-26 16:22:48 +0000 |
commit | dd3818c82cb19570b6b7ddaac277d5f212a432c2 (patch) | |
tree | 504a5a016ea6e585a665d0d6266803793c342732 /gdb | |
parent | 23a806894cd9479188695c85c7b2d5cb7bedb046 (diff) | |
download | gdb-dd3818c82cb19570b6b7ddaac277d5f212a432c2.zip gdb-dd3818c82cb19570b6b7ddaac277d5f212a432c2.tar.gz gdb-dd3818c82cb19570b6b7ddaac277d5f212a432c2.tar.bz2 |
* linespec.c (linespec_lexer_lex_number): The input
is also a valid number if the next character is a comma
or colon.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linespec.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ade6ad5..2906dad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-07-26 Keith Seitz <keiths@redhat.com> + + * linespec.c (linespec_lexer_lex_number): The input + is also a valid number if the next character is a comma + or colon. + 2012-07-26 Joel Brobecker <brobecker@adacore.com> * NEWS: Document new --enable-libmcheck/--disable-libmcheck diff --git a/gdb/linespec.c b/gdb/linespec.c index c72bb4b..3d7f62f 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -366,7 +366,8 @@ static const char *const linespec_quote_characters = "\"\'"; /* Lexer functions. */ /* Lex a number from the input in PARSER. This only supports - decimal numbers.\ + decimal numbers. + Return true if input is decimal numbers. Return false if not. */ static int @@ -389,7 +390,11 @@ linespec_lexer_lex_number (linespec_parser *parser, linespec_token *tokenp) ++(PARSER_STREAM (parser)); } - if (*PARSER_STREAM (parser) != '\0' && !isspace(*PARSER_STREAM (parser))) + /* If the next character in the input buffer is not a space, comma, + or colon, this input does not represent a number. */ + if (*PARSER_STREAM (parser) != '\0' + && !isspace (*PARSER_STREAM (parser)) && *PARSER_STREAM (parser) != ',' + && *PARSER_STREAM (parser) != ':') { PARSER_STREAM (parser) = LS_TOKEN_STOKEN (*tokenp).ptr; return 0; |