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

This commit is contained in:
Benno Schulenberg 2022-08-26 09:29:44 +02:00
parent b1f3bdfcbd
commit cd9402075a
1 changed files with 7 additions and 9 deletions

View File

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