aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-02-03 12:19:26 +0100
committerJan Beulich <jbeulich@suse.com>2025-02-03 12:19:26 +0100
commitf983b224f8fc35adc87d67539e8d669daf7a0c34 (patch)
tree07316446b4204add62de8517b0c1baf283e936cd
parent2dd0370c433da9a6dffd969d6e36d3a086a6380e (diff)
downloadbinutils-f983b224f8fc35adc87d67539e8d669daf7a0c34.zip
binutils-f983b224f8fc35adc87d67539e8d669daf7a0c34.tar.gz
binutils-f983b224f8fc35adc87d67539e8d669daf7a0c34.tar.bz2
rx: use is_whitespace()
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.
-rw-r--r--gas/config/rx-parse.y2
-rw-r--r--gas/config/tc-rx.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/gas/config/rx-parse.y b/gas/config/rx-parse.y
index 60ff2fc..31dad51 100644
--- a/gas/config/rx-parse.y
+++ b/gas/config/rx-parse.y
@@ -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 ++;
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index 7a426d2..bd45c53 100644
--- a/gas/config/tc-rx.c
+++ b/gas/config/tc-rx.c
@@ -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;