Remove path name from test case
[binutils-gdb.git] / binutils / deflex.l
index 54e62c2690c10f52138e5fa63dddb2a608ac75db..d031538fabc9d4b1f5a09b467038b6fa9d91b38d 100644 (file)
@@ -1,8 +1,8 @@
-%option noinput nounput
+%option noinput nounput noyywrap
 
 %{/* deflex.l - Lexer for .def files */
 
-/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -63,20 +63,18 @@ int linenumber;
 [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
                return NUMBER; }
 
-(@)?[A-Za-z$:\-\_?][A-Za-z0-9/$:\<\>\-\_@?]* {
+(@)?[A-Za-z$:\-\_?][A-Za-z0-9/$:\<\>\-\_@?+]* {
                yylval.id =  xstrdup (yytext);
                return ID;
                }
 
 "\""[^\"]*"\"" {
-               yylval.id = xstrdup (yytext+1);
-               yylval.id[yyleng-2] = 0;
+               yylval.id = xmemdup (yytext + 1, yyleng - 2, yyleng - 1);
                return ID;
                }
 
 "\'"[^\']*"\'" {
-               yylval.id = xstrdup (yytext+1);
-               yylval.id[yyleng-2] = 0;
+               yylval.id = xmemdup (yytext + 1, yyleng - 2, yyleng - 1);
                return ID;
                }
 "*".*          { }
@@ -91,7 +89,3 @@ int linenumber;
 "@"            { return '@';}
 ","            { return ',';}
 %%
-#ifndef yywrap
-/* Needed for lex, though not flex. */
-int yywrap(void) { return 1; }
-#endif