nano

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

commit 7d383799192a2dd5f99fc59725a721280450df1f
parent 45bf18f8fed51cc5dc4828cefe55489d2d03cee1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 10 Jun 2019 12:36:16 +0200

tweaks: rename two parameters, away from single letters

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

diff --git a/src/chars.c b/src/chars.c @@ -536,39 +536,39 @@ size_t mbstrlen(const char *pointer) #if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY) /* This function is equivalent to strchr() for multibyte strings. */ -char *mbstrchr(const char *s, const char *c) +char *mbstrchr(const char *string, const char *chr) { #ifdef ENABLE_UTF8 if (use_utf8) { bool bad_s = FALSE, bad_c = FALSE; wchar_t ws, wc; - if (mbtowc(&wc, c, MAXCHARLEN) < 0) { - wc = (unsigned char)*c; + if (mbtowc(&wc, chr, MAXCHARLEN) < 0) { + wc = (unsigned char)*chr; bad_c = TRUE; } - while (*s != '\0') { - int symlen = mbtowc(&ws, s, MAXCHARLEN); + while (*string != '\0') { + int symlen = mbtowc(&ws, string, MAXCHARLEN); if (symlen < 0) { - ws = (unsigned char)*s; + ws = (unsigned char)*string; bad_s = TRUE; } if (ws == wc && bad_s == bad_c) break; - s += symlen; + string += symlen; } - if (*s == '\0') + if (*string == '\0') return NULL; - return (char *)s; + return (char *)string; } else #endif - return strchr(s, *c); + return strchr(string, *chr); } #endif /* !NANO_TINY || ENABLE_JUSTIFY */