tweaks: rename a variable, to be more distinct

master
Benno Schulenberg 2019-03-21 19:21:45 +01:00
parent 23190aa60f
commit b58418b32f
5 changed files with 11 additions and 12 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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