bug#79300: fold-nbsp test failure

Collin Funk <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
Bruno Haible <[email protected]> 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
0001-maint-prefer-c32isspace-to-iswspace.patch (text/x-patch, 945 B)
From 0114629e0c73b6530f551b645097ff93e4663806 Mon Sep 17 00:00:00 2001
Message-ID: <0114629e0c73b6530f551b645097ff93e4663806.1757046213.git.collin.funk1@gmail.com>
From: Collin Funk <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.