]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* linespec.c (linespec_lexer_lex_number): The input
authorKeith Seitz <keiths@redhat.com>
Thu, 26 Jul 2012 16:34:45 +0000 (16:34 +0000)
committerKeith Seitz <keiths@redhat.com>
Thu, 26 Jul 2012 16:34:45 +0000 (16:34 +0000)
is also a valid number if the next character is a comma
or colon.

gdb/ChangeLog
gdb/linespec.c

index 69453149d9bbb31fedd3bb77598d1f79888d7855..d48c8afd9d18ea8345d9d4ce7a5ccf988242dd05 100644 (file)
@@ -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-25  Ralf Corsépius  <ralf.corsepius@rtems.org>
 
        * configure.tgt: Add v850*-*-rtems*.
index 4313008cac6d59d59f14683fd9d4847c77727c8e..861d8ddaaea719427c33ab37fdb73bf329ab44d4 100644 (file)
@@ -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, the 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;