Bruno Haible <br...@clisp.org> writes:

>> P.S. I actually just noticed this unchanged hunk in my diff:
>> 
>> $ git ls-files | grep -E '\.[ch]' | xargs grep -F 'isw'
>> src/wc.c:                      in_word2 = (! iswspace (wide_char)
>> 
>> Okay to change this one to the c32 variant?
>
> Yes. Since 'wide_char' is of type char32_t and produced by mbrtoc32,
> this line should call c32isspace, not iswspace. [1]

Pushed the attatched, thanks.

Collin

>From 0114629e0c73b6530f551b645097ff93e4663806 Mon Sep 17 00:00:00 2001
Message-ID: <0114629e0c73b6530f551b645097ff93e4663806.1757046213.git.collin.fu...@gmail.com>
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 4 Sep 2025 21:13:43 -0700
Subject: [PATCH] maint: prefer c32isspace to iswspace

* src/wc.c (wc): Replace call to iswspace with c32isspace.
---
 src/wc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wc.c b/src/wc.c
index 214637dcf..268b947bb 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -523,7 +523,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
                           if (width > 0)
                             linepos += width;
                         }
-                      in_word2 = (! iswspace (wide_char)
+                      in_word2 = (! c32isspace (wide_char)
                                   && ! maybe_c32isnbspace (wide_char));
                     }
 
-- 
2.51.0

Reply via email to