From 7531d242c93e4ff7d3b2ebeeaf1f0de4dcb6b71c Mon Sep 17 00:00:00 2001 From: andersen Date: Mon, 15 Sep 2003 08:33:45 +0000 Subject: Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize) to ensure proper fallback behavior on, i.e. serial consoles. -Erik git-svn-id: svn://busybox.net/trunk/busybox@7526 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- shell/cmdedit.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 0ab195803..16825089d 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 */ -- cgit v1.2.3-55-g6feb