diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-09-15 08:33:45 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-09-15 08:33:45 +0000 |
| commit | 7531d242c93e4ff7d3b2ebeeaf1f0de4dcb6b71c (patch) | |
| tree | 7590704be6cf03c87242043f5909e12eb4150356 /shell | |
| parent | fc2b3bc3efa6de860a1d3a961c700650e1a590eb (diff) | |
| download | busybox-w32-7531d242c93e4ff7d3b2ebeeaf1f0de4dcb6b71c.tar.gz busybox-w32-7531d242c93e4ff7d3b2ebeeaf1f0de4dcb6b71c.tar.bz2 busybox-w32-7531d242c93e4ff7d3b2ebeeaf1f0de4dcb6b71c.zip | |
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
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/cmdedit.c | 8 |
1 files changed, 3 insertions, 5 deletions
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); | |||
| 167 | 167 | ||
| 168 | static void win_changed(int nsig) | 168 | static void win_changed(int nsig) |
| 169 | { | 169 | { |
| 170 | struct winsize win = { 0, 0, 0, 0 }; | ||
| 171 | static sighandler_t previous_SIGWINCH_handler; /* for reset */ | 170 | static sighandler_t previous_SIGWINCH_handler; /* for reset */ |
| 172 | 171 | ||
| 173 | /* emulate || signal call */ | 172 | /* emulate || signal call */ |
| 174 | if (nsig == -SIGWINCH || nsig == SIGWINCH) { | 173 | if (nsig == -SIGWINCH || nsig == SIGWINCH) { |
| 175 | ioctl(0, TIOCGWINSZ, &win); | 174 | int width = 0; |
| 176 | if (win.ws_col > 0) { | 175 | get_terminal_width_height(0, &width, NULL); |
| 177 | cmdedit_setwidth(win.ws_col, nsig == SIGWINCH); | 176 | cmdedit_setwidth(width, nsig == SIGWINCH); |
| 178 | } | ||
| 179 | } | 177 | } |
| 180 | /* Unix not all standart in recall signal */ | 178 | /* Unix not all standart in recall signal */ |
| 181 | 179 | ||
