Remove an extra "i" in --dll-search-prefix.
[deliverable/binutils-gdb.git] / ld / deffilep.y
index 2121da0ecd9a533b50ecab844b121b398cf97590..e9a63108e35640d3d98efb03f5d6e9af1aa363a7 100644 (file)
@@ -1,6 +1,6 @@
 %{ /* deffilep.y - parser for .def files */
 
-/*   Copyright 1995, 1997, 1998, 1999, 2000, 2001
+/*   Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002
      Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
@@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
-#include <ctype.h>
 #include "libiberty.h"
+#include "safe-ctype.h"
 #include "bfd.h"
 #include "sysdep.h"
 #include "ld.h"
@@ -572,10 +572,10 @@ def_file_add_directive (my_def, param, len)
 
   while (param < pend)
     {
-      while (param < pend && isspace (*param))
+      while (param < pend && ISSPACE (*param))
        param++;
       for (tend = param + 1;
-          tend < pend && !(isspace (tend[-1]) && *tend == '-');
+          tend < pend && !(ISSPACE (tend[-1]) && *tend == '-');
           tend++);
 
       for (i = 0; diropts[i].param; i++)
@@ -949,10 +949,10 @@ def_lex ()
   /* must be something else */
   saw_newline = 0;
 
-  if (isdigit (c))
+  if (ISDIGIT (c))
     {
       bufptr = 0;
-      while (c != EOF && (isxdigit (c) || (c == 'x')))
+      while (c != EOF && (ISXDIGIT (c) || (c == 'x')))
        {
          put_buf (c);
          c = def_getc ();
@@ -966,24 +966,45 @@ def_lex ()
       return NUMBER;
     }
 
-  if (isalpha (c) || strchr ("$:-_?", c))
+  if (ISALPHA (c) || strchr ("$:-_?@", c))
     {
       bufptr = 0;
-      while (c != EOF && (isalnum (c) || strchr ("$:-_?/@", c)))
+      q = c;
+      put_buf (c);
+      c = def_getc ();
+
+      if (q == '@')
+       {
+          if (ISBLANK (c) ) /* '@' followed by whitespace.  */
+           return (q);
+          else if (ISDIGIT (c)) /* '@' followed by digit.  */
+            {
+             def_ungetc (c);
+              return (q);
+           }
+#if TRACE
+         printf ("lex: @ returns itself\n");
+#endif
+       }
+
+      while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@", c)))
        {
          put_buf (c);
          c = def_getc ();
        }
       if (c != EOF)
        def_ungetc (c);
-      for (i = 0; tokens[i].name; i++)
-       if (strcmp (tokens[i].name, buffer) == 0)
-         {
+      if (ISALPHA (q)) /* Check for tokens.  */
+       {
+          for (i = 0; tokens[i].name; i++)
+           if (strcmp (tokens[i].name, buffer) == 0)
+             {
 #if TRACE
-           printf ("lex: `%s' is a string token\n", buffer);
+               printf ("lex: `%s' is a string token\n", buffer);
 #endif
-           return tokens[i].token;
-         }
+               return tokens[i].token;
+             }
+       }
 #if TRACE
       printf ("lex: `%s' returns ID\n", buffer);
 #endif
@@ -1008,7 +1029,7 @@ def_lex ()
       return ID;
     }
 
-  if (c == '=' || c == '.' || c == '@' || c == ',')
+  if (c == '=' || c == '.' || c == ',')
     {
 #if TRACE
       printf ("lex: `%c' returns itself\n", c);
This page took 0.025464 seconds and 4 git commands to generate.