summaryrefslogtreecommitdiff
path: root/gnu/lib/libdialog/msgbox.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-04-20 17:39:37 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-04-20 17:39:37 +0000
commit7f6e7c13b5e6b14351cd46a41d249bff657c2527 (patch)
tree704f5dc77611312a174a02ade2261d68f64fe0c2 /gnu/lib/libdialog/msgbox.c
parent072506ba00189ac9c6ffa15033ca64a65c0e038c (diff)
Notes
Diffstat (limited to 'gnu/lib/libdialog/msgbox.c')
-rw-r--r--gnu/lib/libdialog/msgbox.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c
index abe69dd84fe8..867f64989fbd 100644
--- a/gnu/lib/libdialog/msgbox.c
+++ b/gnu/lib/libdialog/msgbox.c
@@ -200,10 +200,11 @@ dialog_mesgbox(unsigned char *title, unsigned char *prompt, int height, int widt
if (startline < max_lines - theight) startline++;
break;
case KEY_RIGHT:
- hscroll++;
+ hscroll+=5;
break;
case KEY_LEFT:
- if (hscroll > 0) hscroll--;
+ if (hscroll > 0) hscroll-=5;
+ if (hscroll < 0) hscroll =0;
break;
case KEY_PPAGE:
if (startline - height > 0) {
@@ -260,10 +261,11 @@ getnlines(unsigned char *buf)
{
int i = 0;
+ if (*buf)
+ i++;
while (*buf) {
- if (*buf == '\n' || *buf == '\r') {
+ if (*buf == '\n' || *buf == '\r')
i++;
- }
buf++;
}
return(i);