nano

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

commit a8fa0a82c40b25a82fd395122ea8da2d7d313680
parent d19169c263049078a10db7f6cbd2cad98e0bd87f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 17 Sep 2018 20:35:13 +0200

tweaks: rename a variable to be special and distinct

Diffstat:
Msrc/help.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/help.c b/src/help.c @@ -499,7 +499,7 @@ void help_init(void) /* Now add our shortcut info. */ for (f = allfuncs; f != NULL; f = f->next) { - int scsfound = 0; + int tally = 0; if ((f->menus & currmenu) == 0) continue; @@ -507,10 +507,9 @@ void help_init(void) /* Let's simply show the first two shortcuts from the list. */ for (s = sclist; s != NULL; s = s->next) { if ((s->menus & currmenu) && s->func == f->func) { - scsfound++; /* Make the first column narrower (6) than the second (10), * but allow it to spill into the second, for "M-Space". */ - if (scsfound == 1) { + if (++tally == 1) { sprintf(ptr, "%s ", s->keystr); /* Unicode arrows take three bytes instead of one. */ ptr += (strstr(s->keystr, "\xE2") != NULL ? 8 : 6); @@ -521,9 +520,9 @@ void help_init(void) } } - if (scsfound == 0) + if (tally == 0) ptr += sprintf(ptr, "\t\t"); - else if (scsfound == 1) + else if (tally == 1) ptr += 10; /* The shortcut's help text. */