$NetBSD: patch-aj,v 1.2 1998/08/07 11:10:15 agc Exp $ --- yesno.c.orig Fri Jan 23 17:37:13 1998 +++ yesno.c Fri Jan 23 18:17:16 1998 @@ -26,8 +26,18 @@ int dialog_yesno (const char *title, const char *prompt, int height, int width) { - int i, x, y, key = 0, button = 0; + int i, j, x, y, key = 0, button = 0; WINDOW *dialog; + + /* Choose useful default height and width if they are negative */ + if (height < 0) + height = strheight(prompt) + 4; + if (width < 0) { + i = strwidth(prompt); + j = ((title != NULL) ? strwidth(title) : 0); + width = MAX (i, j) + 4; + } + width = MAX (width, MIN_DIALOG_WIDTH); /* center dialog box on screen */ x = (COLS - width) / 2;