From b58418b32f362b8f4996d4e18642a7818fe87be7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 21 Mar 2019 19:21:45 +0100 Subject: [PATCH] tweaks: rename a variable, to be more distinct --- src/global.c | 2 +- src/nano.c | 8 ++++---- src/proto.h | 2 +- src/rcfile.c | 5 ++--- src/winio.c | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/global.c b/src/global.c index f8f05b81..3dd07882 100644 --- a/src/global.c +++ b/src/global.c @@ -135,7 +135,7 @@ char *matchbrackets = NULL; /* The opening and closing brackets that bracket searches can find. */ char *whitespace = NULL; /* The characters used when visibly showing tabs and spaces. */ -int whitespace_len[2]; +int whitelen[2]; /* The length in bytes of these characters. */ #endif diff --git a/src/nano.c b/src/nano.c index e930b76f..bed082e8 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2536,14 +2536,14 @@ int main(int argc, char **argv) /* A tab is shown as a Right-Pointing Double Angle Quotation Mark * (U+00BB), and a space as a Middle Dot (U+00B7). */ whitespace = mallocstrcpy(NULL, "\xC2\xBB\xC2\xB7"); - whitespace_len[0] = 2; - whitespace_len[1] = 2; + whitelen[0] = 2; + whitelen[1] = 2; } else #endif { whitespace = mallocstrcpy(NULL, ">."); - whitespace_len[0] = 1; - whitespace_len[1] = 1; + whitelen[0] = 1; + whitelen[1] = 1; } } #endif /* !NANO_TINY */ diff --git a/src/proto.h b/src/proto.h index 84636258..f25a175d 100644 --- a/src/proto.h +++ b/src/proto.h @@ -103,7 +103,7 @@ extern openfilestruct *firstfile; #ifndef NANO_TINY extern char *matchbrackets; extern char *whitespace; -extern int whitespace_len[2]; +extern int whitelen[2]; #endif extern const char *exit_tag; diff --git a/src/rcfile.c b/src/rcfile.c index 113fafec..1df7e540 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -1139,9 +1139,8 @@ void parse_rcfile(FILE *rcstream, bool syntax_only) free(option); } else { whitespace = option; - whitespace_len[0] = parse_mbchar(whitespace, NULL, NULL); - whitespace_len[1] = parse_mbchar(whitespace + - whitespace_len[0], NULL, NULL); + whitelen[0] = parse_mbchar(whitespace, NULL, NULL); + whitelen[1] = parse_mbchar(whitespace + whitelen[0], NULL, NULL); } } else #endif diff --git a/src/winio.c b/src/winio.c index 0ba0faf0..bbd8371e 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1921,9 +1921,9 @@ char *display_string(const char *buf, size_t column, size_t span, /* Show a space as a visible character, or as a space. */ #ifndef NANO_TINY if (ISSET(WHITESPACE_DISPLAY)) { - int i = whitespace_len[0]; + int i = whitelen[0]; - while (i < whitespace_len[0] + whitespace_len[1]) + while (i < whitelen[0] + whitelen[1]) converted[index++] = whitespace[i++]; } else #endif @@ -1939,7 +1939,7 @@ char *display_string(const char *buf, size_t column, size_t span, column == start_col)) { int i = 0; - while (i < whitespace_len[0]) + while (i < whitelen[0]) converted[index++] = whitespace[i++]; } else #endif