public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] arc: use is_whitespace()
Date: Mon,  3 Feb 2025 10:52:01 +0000 (GMT)	[thread overview]
Message-ID: <20250203105201.1FBC53858C5F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6dbfaa3fb3e35504a6a7cfb6b128ae3c5ab2b900

commit 6dbfaa3fb3e35504a6a7cfb6b128ae3c5ab2b900
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Feb 3 11:50:03 2025 +0100

    arc: 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). At the same time use is_end_of_stmt() instead of
    open-coded nul char checks.

Diff:
---
 gas/config/tc-arc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 8b69ca6d1f7..30d6cb9c50d 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -1374,10 +1374,6 @@ tokenize_flags (const char *str,
     {
       switch (*input_line_pointer)
 	{
-	case ' ':
-	case '\0':
-	  goto fini;
-
 	case '.':
 	  input_line_pointer++;
 	  if (saw_dot)
@@ -1387,6 +1383,10 @@ tokenize_flags (const char *str,
 	  break;
 
 	default:
+	  if (is_end_of_stmt (*input_line_pointer)
+	      || is_whitespace (*input_line_pointer))
+	    goto fini;
+
 	  if (saw_flg && !saw_dot)
 	    goto err;
 
@@ -2536,8 +2536,8 @@ md_assemble (char *str)
   /* Scan up to the end of the mnemonic which must end in space or end
      of string.  */
   str += opnamelen;
-  for (; *str != '\0'; str++)
-    if (*str == ' ')
+  for (; !is_end_of_stmt (*str); str++)
+    if (is_whitespace (*str))
       break;
 
   /* Tokenize the rest of the line.  */

                 reply	other threads:[~2025-02-03 10:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250203105201.1FBC53858C5F@sourceware.org \
    --to=jbeulich@sourceware.org \
    --cc=binutils-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).