nano

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

commit 45bf18f8fed51cc5dc4828cefe55489d2d03cee1
parent 787dca6724dced8c9f43e199a3ee469b21edbfe8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 10 Jun 2019 12:29:49 +0200

tweaks: rename three variables, to get rid of a suffix or an underscore

Also drop an unneeded cast.

Diffstat:
Msrc/chars.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/chars.c b/src/chars.c @@ -540,26 +540,26 @@ char *mbstrchr(const char *s, const char *c) { #ifdef ENABLE_UTF8 if (use_utf8) { - bool bad_s_mb = FALSE, bad_c_mb = FALSE; + bool bad_s = FALSE, bad_c = FALSE; wchar_t ws, wc; if (mbtowc(&wc, c, MAXCHARLEN) < 0) { wc = (unsigned char)*c; - bad_c_mb = TRUE; + bad_c = TRUE; } while (*s != '\0') { - int sym_len = mbtowc(&ws, s, MAXCHARLEN); + int symlen = mbtowc(&ws, s, MAXCHARLEN); - if (sym_len < 0) { + if (symlen < 0) { ws = (unsigned char)*s; - bad_s_mb = TRUE; + bad_s = TRUE; } - if (bad_s_mb == bad_c_mb && ws == wc) + if (ws == wc && bad_s == bad_c) break; - s += sym_len; + s += symlen; } if (*s == '\0') @@ -568,7 +568,7 @@ char *mbstrchr(const char *s, const char *c) return (char *)s; } else #endif - return (char *)strchr(s, *c); + return strchr(s, *c); } #endif /* !NANO_TINY || ENABLE_JUSTIFY */