From: Miroslav Lichvar Date: Thu, 24 Nov 2022 13:50:04 +0000 (+0100) Subject: check for zero menu/list height in whiptail X-Git-Tag: r0-52-23~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb5f279ba38444fe2dd0b25f45269642ef0401eb;p=thirdparty%2Fnewt.git check for zero menu/list height in whiptail When the specified window height and width are larger than zero, but the menu/list height is zero, calculate all three values to fit the specified entries. --- diff --git a/whiptail.c b/whiptail.c index 773793a..0dd60a7 100644 --- a/whiptail.c +++ b/whiptail.c @@ -328,7 +328,7 @@ int main(int argc, const char ** argv) { char * end; int height; int width; - int listHeight = 0; + int listHeight = 1; int fd = -1; int needSpace = 0; int noCancel = 0; @@ -523,7 +523,7 @@ int main(int argc, const char ** argv) { cleanNewlines(text); - if ( height <= 0 || width <= 0 ) + if (height <= 0 || width <= 0 || listHeight <= 0) guessSize(&height, &width, &listHeight, mode, &flags, fullButtons, title, text, optCon);