Re: [PATCH] wip: change ISSPACE to use ascii whitespace check.
"Kevin J. McCarthy" <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <aZcCgJSA4j-JSXEe@qinghai> |
On Wed, Feb 18, 2026 at 03:20:25PM +0100, Alejandro Colomar wrote: >I've been looking at these functions and macros recently in neomutt(1), >and I was thinking that maybe we should have macros that define the >specific different kinds of white space. Something like this: > > #define MUTT_CTYPE_SPACE_C " \t\n\v\f\r" // [:space:] > #define MUTT_CTYPE_RFC5322_FWS " \t\r\n" // 'FWS' (3.2.2.) > >then, we could use it for example here to replace the SKIPWS() call as > > s += strspn(s, MUTT_CTYPE_SPACE_C); > >The name of the white-space macro would make it more readable to >understand exactly which kind of white space is used in each call. > >Also, strspn() is C89 standard, and quite simple to understand, compared >to groking all the different macros --with inconsistent names-- we have. > >What do you think? I'm not dead set against it, but I've never thought the macros or naming were confusing. Making the implementation of each the same seems like a good idea, but I think it would be a shame to get ride of the skip_xxx() and is_xxx() macros. To me they make the code more readable, not less. However, I've been looking at the code for a long time, so I'm sure I'm biased by familiarity. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmmXAoAACgkQre92hIAx a9qWpQ//bK5AzzBuQsymPr94X9QssjI5uxicBFVVOCU9WqBf3yXQ4J1kHiQCqgA2 zjBBY9cp+oawUYTGN+kaVSIwESMi6K9j+3qMo9zymto4l+luGIXQyMpXCVIQzkc1 kUfXw72XAoaLCDVNtUwOVrSK2SMRFZUnEkc92R0dKG35bkDCkOuJTxVFoDfHA2RO J7nNrh/DY4bekHnItY66HQhSmmMXHOPKwxmukX9A3UR3N/e/FVp/KbOjAY7Xgw6O VzLy9rHbIrkiWq3jrgZ9pZTssgAQoIVFB260ZoeIeGQMBIiusNOpMyx49QYyeTnd Qx3icGTqaHaNlJh2UhKLfIxro/f24SRjY7RG+Uf1EGaA8ZJ1XIEZ9N0DPJgNQFKq 00pQZ9zd2/aos7E5swwVdhsTjk1iwJOfkSw6gRcgYWHlL9GUUiEhXCXDve5cC+7Y 7pEoET8Lcf1pFxQRI+q7sc296dQGRVqeiFIcBSTz02WnuSgAanImftCTN/cqWKr5 rQrwEd1MFmwXfzBcWL4LZ0KutntZ+gq3qTOoAaXirQteuuMZpps4BYVTe1CQ/3XM 4PFg0zep4Nk9HgR9C3E9i4xA2JyaT8Z6M2SBoymB8IVZfvDuEbcfvr0nElhntYGr FLX1Vi6E3+aF+w/t/IP3buzjnVkdDW3gEeSA+vcOHBJU9+pNGQ8= =uE7v -----END PGP SIGNATURE-----