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