diff options
Diffstat (limited to 'scripts/lxdialog/inputbox.c')
-rw-r--r-- | scripts/lxdialog/inputbox.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/scripts/lxdialog/inputbox.c b/scripts/lxdialog/inputbox.c index bc135c7093d9..779503726b0a 100644 --- a/scripts/lxdialog/inputbox.c +++ b/scripts/lxdialog/inputbox.c | |||
@@ -66,20 +66,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
66 | wattrset(dialog, dialog_attr); | 66 | wattrset(dialog, dialog_attr); |
67 | waddch(dialog, ACS_RTEE); | 67 | waddch(dialog, ACS_RTEE); |
68 | 68 | ||
69 | if (title != NULL && strlen(title) >= width - 2) { | 69 | print_title(dialog, title, width); |
70 | /* truncate long title -- mec */ | ||
71 | char *title2 = malloc(width - 2 + 1); | ||
72 | memcpy(title2, title, width - 2); | ||
73 | title2[width - 2] = '\0'; | ||
74 | title = title2; | ||
75 | } | ||
76 | |||
77 | if (title != NULL) { | ||
78 | wattrset(dialog, title_attr); | ||
79 | mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' '); | ||
80 | waddstr(dialog, (char *)title); | ||
81 | waddch(dialog, ' '); | ||
82 | } | ||
83 | 70 | ||
84 | wattrset(dialog, dialog_attr); | 71 | wattrset(dialog, dialog_attr); |
85 | print_autowrap(dialog, prompt, width - 2, 1, 3); | 72 | print_autowrap(dialog, prompt, width - 2, 1, 3); |