nano

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

commit cd9402075a2a8931b7c4e32817eee9187bfe239b
parent b1f3bdfcbd61ae28ee6c00029c015d8743ccf3f5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 26 Aug 2022 09:29:44 +0200

tweaks: elide a variable, rename another, and reshuffle an assignment

Diffstat:
Msrc/winio.c | 16+++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -3602,7 +3602,7 @@ void do_credits(void) { bool with_interface = !ISSET(ZERO); bool with_help = !ISSET(NO_HELP); - int kbinput = ERR, crpos = 0, xlpos = 0; + int crpos = 0, xlpos = 0; const char *credits[CREDIT_LEN] = { NULL, /* "The nano text editor" */ @@ -3686,25 +3686,23 @@ void do_credits(void) for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) { if (crpos < CREDIT_LEN) { - const char *what; + const char *text = credits[crpos]; - if (credits[crpos] == NULL) - what = _(xlcredits[xlpos++]); - else - what = credits[crpos]; + if (!text) + text = _(xlcredits[xlpos++]); - mvwaddstr(midwin, editwinrows - 1, (COLS - breadth(what)) / 2, what); + mvwaddstr(midwin, editwinrows - 1, (COLS - breadth(text)) / 2, text); wrefresh(midwin); } - if ((kbinput = wgetch(midwin)) != ERR) + if (wgetch(midwin) != ERR) break; napms(600); wscrl(midwin, 1); wrefresh(midwin); - if ((kbinput = wgetch(midwin)) != ERR) + if (wgetch(midwin) != ERR) break; napms(600);