diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1994-11-16 14:37:37 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1994-11-16 14:37:37 +0000 |
| commit | 5f5d7caab1c5b509d30df5bd914f2b15998fca65 (patch) | |
| tree | 6d42ce10ce8c7263feab1c0a86525a16826ae40e /gnu/lib/libdialog/msgbox.c | |
| parent | 0066ef2281a7155ad3416190995f8398372b0816 (diff) | |
Notes
Diffstat (limited to 'gnu/lib/libdialog/msgbox.c')
| -rw-r--r-- | gnu/lib/libdialog/msgbox.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c index e405f3b5a26a..fda3b40641a9 100644 --- a/gnu/lib/libdialog/msgbox.c +++ b/gnu/lib/libdialog/msgbox.c @@ -29,9 +29,17 @@ */ int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int width, int pause) { - int i, x, y, key = 0; + int i, j, x, y, key = 0; WINDOW *dialog; + if (height < 0) + height = strheight(prompt)+2+2*(!!pause); + if (width < 0) { + i = strwidth(prompt); + j = strwidth(title); + width = MAX(i,j)+4; + } + /* center dialog box on screen */ x = (COLS - width)/2; y = (LINES - height)/2; |
