[BusyBox-cvs] busybox/shell cmdedit.c,1.82,1.83
Erik Andersen
andersen at busybox.net
Mon Sep 15 08:33:44 UTC 2003
Update of /var/cvs/busybox/shell
In directory winder:/tmp/cvs-serv10511/shell
Modified Files:
cmdedit.c
Log Message:
Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
-Erik
Index: cmdedit.c
===================================================================
RCS file: /var/cvs/busybox/shell/cmdedit.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- cmdedit.c 29 Jul 2003 06:38:40 -0000 1.82
+++ cmdedit.c 15 Sep 2003 08:33:40 -0000 1.83
@@ -167,15 +167,13 @@
static void win_changed(int nsig)
{
- struct winsize win = { 0, 0, 0, 0 };
static sighandler_t previous_SIGWINCH_handler; /* for reset */
/* emulate || signal call */
if (nsig == -SIGWINCH || nsig == SIGWINCH) {
- ioctl(0, TIOCGWINSZ, &win);
- if (win.ws_col > 0) {
- cmdedit_setwidth(win.ws_col, nsig == SIGWINCH);
- }
+ int width = 0;
+ get_terminal_width_height(0, &width, NULL);
+ cmdedit_setwidth(width, nsig == SIGWINCH);
}
/* Unix not all standart in recall signal */
More information about the busybox-cvs
mailing list