patch-2.2.2 linux/scripts/lxdialog/msgbox.c
Next file: linux/scripts/lxdialog/textbox.c
Previous file: linux/scripts/lxdialog/menubox.c
Back to the patch index
Back to the overall index
- Lines: 15
- Date:
Mon Feb 1 12:03:20 1999
- Orig file:
v2.2.1/linux/scripts/lxdialog/msgbox.c
- Orig date:
Tue Feb 6 23:47:28 1996
diff -u --recursive --new-file v2.2.1/linux/scripts/lxdialog/msgbox.c linux/scripts/lxdialog/msgbox.c
@@ -43,6 +43,14 @@
draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
if (title != NULL) {
wattrset (dialog, title_attr);
mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)