diff options
Diffstat (limited to 'contrib/bsddialog/lib/messagebox.c')
-rw-r--r-- | contrib/bsddialog/lib/messagebox.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/bsddialog/lib/messagebox.c b/contrib/bsddialog/lib/messagebox.c index fc18ff8a61d2..5132b1b089b8 100644 --- a/contrib/bsddialog/lib/messagebox.c +++ b/contrib/bsddialog/lib/messagebox.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2021-2023 Alfonso Sabato Siciliano + * Copyright (c) 2021-2024 Alfonso Sabato Siciliano * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -87,7 +87,7 @@ static int message_draw(struct dialog *d, struct scroll *s) s->printrows = d->h - BORDER - HBUTTONS - BORDER; s->ypad = 0; getmaxyx(d->textpad, s->htextpad, unused); - unused++; /* fix unused error */ + (void)unused; /* fix unused error */ return (0); } @@ -106,7 +106,7 @@ do_message(struct bsddialog_conf *conf, const char *text, int rows, int cols, return (BSDDIALOG_ERROR); set_buttons(&d, true, oklabel, cancellabel); s.htext = -1; - if(message_draw(&d, &s) != 0) + if (message_draw(&d, &s) != 0) return (BSDDIALOG_ERROR); loop = true; @@ -138,10 +138,14 @@ do_message(struct bsddialog_conf *conf, const char *text, int rows, int cols, d.bs.curr = d.bs.nbuttons - 1; DRAW_BUTTONS(d); break; + case '-': + case KEY_CTRL('p'): case KEY_UP: if (s.ypad > 0) s.ypad--; break; + case '+': + case KEY_CTRL('n'): case KEY_DOWN: if (s.ypad + s.printrows < s.htextpad) s.ypad++; @@ -166,11 +170,12 @@ do_message(struct bsddialog_conf *conf, const char *text, int rows, int cols, break; if (f1help_dialog(d.conf) != 0) return (BSDDIALOG_ERROR); - if(message_draw(&d, &s) != 0) + if (message_draw(&d, &s) != 0) return (BSDDIALOG_ERROR); break; + case KEY_CTRL('l'): case KEY_RESIZE: - if(message_draw(&d, &s) != 0) + if (message_draw(&d, &s) != 0) return (BSDDIALOG_ERROR); break; default: |