Re: [PATCH] wip: change ISSPACE to use ascii whitespace check.

Ian Collier via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Thu, Feb 19, 2026 at 01:46:34AM +0100, Alejandro Colomar via Mutt-dev wrote:
> On 2026-02-18T23:42:28+0000, Ian Collier via Mutt-dev wrote:
> > I do not understand why strchrnul and strcmp are even being invoked here.

> Because they are necessary.  (Well, strcmp(3) is not, as you could do
> manual byte operations, but it's simple, more readable, and optimized
> out.)  strchrnul(3) is necessary.

> 	strchr(s, '\0') != NULL

> would evaluate to true, which is a misbehavior: it would treat '\0' as
> white space, while it is not. 

The nul character is a bit of an edge case when considering strxxx functions,
of course.  But that's easily fixed:

 c && strchr(s, c) != NULL

No doubt you'll now be telling me that you don't want to evaluate c twice
in the context of a macro.  Well then, use an inline function. :-)

imc
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.