nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 1c3953705c376e1eedeb07008fe238b54e7354db
parent b58418b32f362b8f4996d4e18642a7818fe87be7
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 24 Mar 2019 09:29:58 +0100

tweaks: avoid parsing the same character twice

Also, make the second loop similar in form to the first.

Diffstat:
Msrc/chars.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/chars.c b/src/chars.c @@ -644,8 +644,8 @@ bool has_blank_char(const char *s) if (use_utf8) { char symbol[MAXCHARLEN]; - for (; *s != '\0'; s += move_mbright(s, 0)) { - parse_mbchar(s, symbol, NULL); + while (*s != '\0') { + s += parse_mbchar(s, symbol, NULL); if (is_blank_mbchar(symbol)) return TRUE; @@ -653,9 +653,10 @@ bool has_blank_char(const char *s) } else #endif { - for (; *s != '\0'; s++) { + while (*s != '\0') { if (isblank((unsigned char)*s)) return TRUE; + s++; } }