summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen2003-09-15 08:33:45 +0000
committerEric Andersen2003-09-15 08:33:45 +0000
commit8efe967018dd79aacfe3ca1e2583f115d744e466 (patch)
tree7590704be6cf03c87242043f5909e12eb4150356 /shell
parentc4f72d1426e03f046ac54a00d733a4a52c3a5d4b (diff)
downloadbusybox-8efe967018dd79aacfe3ca1e2583f115d744e466.zip
busybox-8efe967018dd79aacfe3ca1e2583f115d744e466.tar.gz
Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles. -Erik
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 0ab1958..1682508 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -167,15 +167,13 @@ static void cmdedit_setwidth(int w, int redraw_flg);
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 */