]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
rx: use is_whitespace()
authorJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:19:26 +0000 (12:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 Feb 2025 11:19:26 +0000 (12:19 +0100)
Wherever blanks are permissible in input, tabs ought to be permissible,
too. This is particularly relevant when -f is passed to gas (alongside
appropriate input). Also convert open-coded checks as well as ISSPACE()
uses. At the same time use is_end_of_stmt() instead of an open-coded
check in adjacent code.

gas/config/rx-parse.y
gas/config/tc-rx.c

index 60ff2fc0a1e5419ceb949dd110870ec07d6e7174..31dad51309103bf4bbf35f01d2fa7a871164e3b3 100644 (file)
@@ -1583,7 +1583,7 @@ rx_lex (void)
   unsigned int ci;
   char * save_input_pointer;
 
-  while (ISSPACE (*rx_lex_start)
+  while (is_whitespace (*rx_lex_start)
         && rx_lex_start != rx_lex_end)
     rx_lex_start ++;
 
index 7a426d281dfa4183a5cd5b66a3b526cffe9adce4..bd45c53cfa0545a558c877d59160db89f64d2bf1 100644 (file)
@@ -282,7 +282,8 @@ rx_include (int ignore)
   last_char = find_end_of_line (filename, false);
   input_line_pointer = last_char;
 
-  while (last_char >= filename && (* last_char == ' ' || * last_char == '\n'))
+  while (last_char >= filename
+        && (is_whitespace (* last_char) || is_end_of_stmt (* last_char)))
     -- last_char;
   end_char = *(++ last_char);
   * last_char = 0;
@@ -425,14 +426,14 @@ parse_rx_section (char * name)
        {
          *p = end_char;
 
-         if (end_char == ' ')
-           while (ISSPACE (*p))
+         if (is_whitespace (end_char))
+           while (is_whitespace (*p))
              p++;
 
          if (*p == '=')
            {
              ++ p;
-             while (ISSPACE (*p))
+             while (is_whitespace (*p))
                p++;
              switch (*p)
                {
@@ -517,7 +518,7 @@ rx_section (int ignore)
     {
       int len = p - input_line_pointer;
 
-      while (ISSPACE (*++p))
+      while (is_whitespace (*++p))
        ;
 
       if (*p != '"' && *p != '#')
@@ -1060,7 +1061,7 @@ rx_equ (char * name, char * expression)
   char * name_end;
   char * saved_ilp;
 
-  while (ISSPACE (* name))
+  while (is_whitespace (* name))
     name ++;
 
   for (name_end = name + 1; *name_end; name_end ++)
@@ -1094,7 +1095,7 @@ scan_for_infix_rx_pseudo_ops (char * str)
     return false;
 
   /* A real pseudo-op must be preceded by whitespace.  */
-  if (dot[-1] != ' ' && dot[-1] != '\t')
+  if (!is_whitespace (dot[-1]))
     return false;
 
   pseudo_op = dot + 1;