diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-09 08:27:24 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-09 08:27:24 +0000 |
commit | f893da875a24138fac30f070c7101b5330f0fef0 (patch) | |
tree | ede441ba82f7a1bf9942ba33a64e91bcd8173920 /procps/ps.c | |
parent | 501bfe2630054f9988e08a5d77e1b1ff2abc78bb (diff) | |
download | busybox-w32-f893da875a24138fac30f070c7101b5330f0fef0.tar.gz busybox-w32-f893da875a24138fac30f070c7101b5330f0fef0.tar.bz2 busybox-w32-f893da875a24138fac30f070c7101b5330f0fef0.zip |
ls,ps,watch: measure terminal width on fd 0, not 1
Diffstat (limited to 'procps/ps.c')
-rw-r--r-- | procps/ps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/procps/ps.c b/procps/ps.c index 50b6a6c94..5150a08a2 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -322,7 +322,7 @@ int ps_main(int argc, char **argv) | |||
322 | * and such large widths */ | 322 | * and such large widths */ |
323 | terminal_width = MAX_WIDTH; | 323 | terminal_width = MAX_WIDTH; |
324 | if (isatty(1)) { | 324 | if (isatty(1)) { |
325 | get_terminal_width_height(1, &terminal_width, NULL); | 325 | get_terminal_width_height(0, &terminal_width, NULL); |
326 | if (--terminal_width > MAX_WIDTH) | 326 | if (--terminal_width > MAX_WIDTH) |
327 | terminal_width = MAX_WIDTH; | 327 | terminal_width = MAX_WIDTH; |
328 | } | 328 | } |
@@ -364,7 +364,7 @@ int ps_main(int argc, char **argv) | |||
364 | if (w_count) { | 364 | if (w_count) { |
365 | terminal_width = (w_count==1) ? 132 : MAX_WIDTH; | 365 | terminal_width = (w_count==1) ? 132 : MAX_WIDTH; |
366 | } else { | 366 | } else { |
367 | get_terminal_width_height(1, &terminal_width, NULL); | 367 | get_terminal_width_height(0, &terminal_width, NULL); |
368 | /* Go one less... */ | 368 | /* Go one less... */ |
369 | if (--terminal_width > MAX_WIDTH) | 369 | if (--terminal_width > MAX_WIDTH) |
370 | terminal_width = MAX_WIDTH; | 370 | terminal_width = MAX_WIDTH; |