On 03/09/2025 05:04, Collin Funk wrote:
Pádraig Brady <p...@draigbrady.com> writes:

Thanks, I forgot about that function. That sounds like a good idea
to
me. We can be nice to people who do not use glibc.
We will have to hoist the 'posixly_correct' check out of it before
though. Technically POSIX says that 'fold -s' should only break at
<blank> characters. But I rather avoid adding more
getenv ("POSIXLY_CORRECT") to programs that do not yet have them.

Yes I agree that fold should not depend on POSIXLY_CORRECT,
so c32isnbspace() should only look at the passed char.

This patch should do the trick. It fixes it on Solaris 11.4 (cfarm215).
I couldn't reproduce the failure seen on the CI machines in my NetBSD 10
VM. But I see no reason why this fix wouldn't work there too.

Will push it tomorrow.

I would have left iswnbspace() in wc.c, calling into c32isnbspace(),
otherwise the double negative with posixly_correct is awkward.
Anyway the logic looks good.

thanks!
Padraig



Reply via email to