diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-09-13 22:48:30 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-09-13 22:48:30 +0200 |
commit | 8187e0143874e1bf0412263e716cf8c782a5aa16 (patch) | |
tree | 289b592b43a7226bbd355728798930c9ead45893 /procps/watch.c | |
parent | 136946c3ea6a14d391b5045b5eb71fa8ec207077 (diff) | |
download | busybox-w32-8187e0143874e1bf0412263e716cf8c782a5aa16.tar.gz busybox-w32-8187e0143874e1bf0412263e716cf8c782a5aa16.tar.bz2 busybox-w32-8187e0143874e1bf0412263e716cf8c782a5aa16.zip |
*: use ESC define instead of "\033"; use ESC[m instead of ESC[0m
text data bss dec hex filename
922535 481 6832 929848 e3038 busybox_old
922534 481 6832 929847 e3037 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps/watch.c')
-rw-r--r-- | procps/watch.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/procps/watch.c b/procps/watch.c index 6fc9f7db7..e58fd1f11 100644 --- a/procps/watch.c +++ b/procps/watch.c | |||
@@ -37,6 +37,8 @@ | |||
37 | 37 | ||
38 | #include "libbb.h" | 38 | #include "libbb.h" |
39 | 39 | ||
40 | #define ESC "\033" | ||
41 | |||
40 | // procps 2.0.18: | 42 | // procps 2.0.18: |
41 | // watch [-d] [-n seconds] | 43 | // watch [-d] [-n seconds] |
42 | // [--differences[=cumulative]] [--interval=seconds] command | 44 | // [--differences[=cumulative]] [--interval=seconds] command |
@@ -77,7 +79,7 @@ int watch_main(int argc UNUSED_PARAM, char **argv) | |||
77 | header = NULL; | 79 | header = NULL; |
78 | while (1) { | 80 | while (1) { |
79 | /* home; clear to the end of screen */ | 81 | /* home; clear to the end of screen */ |
80 | printf("\033[H""\033[J"); | 82 | printf(ESC"[H" ESC"[J"); |
81 | if (!(opt & 0x2)) { // no -t | 83 | if (!(opt & 0x2)) { // no -t |
82 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); | 84 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); |
83 | 85 | ||