aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-01-30 14:11:58 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-01-30 14:11:58 +0000
commit255ec70534cbcfc3acc5ca510233b09dc093e700 (patch)
tree8fef152ce7e55c355dc552942299c434c3426349 /gnu
parent7cb18415b8a370eef92a029067988617b4eb84f3 (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libdialog/checklist.c3
-rw-r--r--gnu/lib/libdialog/inputbox.c3
-rw-r--r--gnu/lib/libdialog/menubox.c3
-rw-r--r--gnu/lib/libdialog/msgbox.c4
-rw-r--r--gnu/lib/libdialog/prgbox.c2
-rw-r--r--gnu/lib/libdialog/radiolist.c3
-rw-r--r--gnu/lib/libdialog/yesno.c3
7 files changed, 15 insertions, 6 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c
index c31a9305903cf..964a1b67098b5 100644
--- a/gnu/lib/libdialog/checklist.c
+++ b/gnu/lib/libdialog/checklist.c
@@ -65,10 +65,11 @@ int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, in
height = strheight(prompt)+list_height+4+2;
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j);
width = MAX(width,check_x+4)+4;
}
+ width = MAX(width,24);
if (width > COLS)
width = COLS;
diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c
index 61dd2f21248f6..b69267f1c950b 100644
--- a/gnu/lib/libdialog/inputbox.c
+++ b/gnu/lib/libdialog/inputbox.c
@@ -37,9 +37,10 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int
height = strheight(prompt)+2+4;
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j) + 4;
}
+ width = MAX(width,24);
if (width > COLS)
width = COLS;
diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c
index ed82ae5670bc0..22c7bc0285e0b 100644
--- a/gnu/lib/libdialog/menubox.c
+++ b/gnu/lib/libdialog/menubox.c
@@ -55,10 +55,11 @@ int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int wid
height = strheight(prompt)+menu_height+4+2;
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j);
width = MAX(width,tag_x+4)+4;
}
+ width = MAX(width,24);
if (width > COLS)
width = COLS;
diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c
index 50f6c13b20573..f8ca26fc55719 100644
--- a/gnu/lib/libdialog/msgbox.c
+++ b/gnu/lib/libdialog/msgbox.c
@@ -36,9 +36,11 @@ int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int w
height = strheight(prompt)+2+2*(!!pause);
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j)+4;
}
+ if (pause)
+ width = MAX(width,10);
if (width > COLS)
width = COLS;
diff --git a/gnu/lib/libdialog/prgbox.c b/gnu/lib/libdialog/prgbox.c
index 53275bfd704e2..f2c7c6a5fb993 100644
--- a/gnu/lib/libdialog/prgbox.c
+++ b/gnu/lib/libdialog/prgbox.c
@@ -39,6 +39,8 @@ int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, i
fprintf(stderr, "\nAutosizing is impossible in dialog_prgbox().\n");
exit(-1);
}
+ width = MAX(width,10);
+
if (width > COLS)
width = COLS;
if (height > LINES)
diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c
index 5b8a68fff56d6..417f2ab556acf 100644
--- a/gnu/lib/libdialog/radiolist.c
+++ b/gnu/lib/libdialog/radiolist.c
@@ -73,10 +73,11 @@ int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, in
height = strheight(prompt)+list_height+4+2;
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j);
width = MAX(width,check_x+4)+4;
}
+ width = MAX(width,24);
if (width > COLS)
width = COLS;
diff --git a/gnu/lib/libdialog/yesno.c b/gnu/lib/libdialog/yesno.c
index 8d253608e6bb5..20799b656531c 100644
--- a/gnu/lib/libdialog/yesno.c
+++ b/gnu/lib/libdialog/yesno.c
@@ -35,9 +35,10 @@ int dialog_yesno(unsigned char *title, unsigned char * prompt, int height, int w
height = strheight(prompt)+4;
if (width < 0) {
i = strwidth(prompt);
- j = strwidth(title);
+ j = ((title != NULL) ? strwidth(title) : 0);
width = MAX(i,j)+4;
}
+ width = MAX(width,23);
if (width > COLS)
width = COLS;