diff options
author | Ron Yorston <rmy@pobox.com> | 2023-04-23 09:00:04 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-04-23 09:04:01 +0100 |
commit | 0575aaaa0779812752427badbc0f80a09aac02a4 (patch) | |
tree | 350b636dad1766e43d1d0c7d132a895c3cc2a628 /procps | |
parent | 7b81a44c87cf71dfb4f647ba107624e208ffbefe (diff) | |
download | busybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.tar.gz busybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.tar.bz2 busybox-w32-0575aaaa0779812752427badbc0f80a09aac02a4.zip |
win32: export xappendword()
Export the function xappendword() from make. Use it in drop and
watch.
Saves 8-80 bytes, an unusually large disparity.
Diffstat (limited to 'procps')
-rw-r--r-- | procps/watch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/procps/watch.c b/procps/watch.c index 1190b29df..56b128df6 100644 --- a/procps/watch.c +++ b/procps/watch.c | |||
@@ -71,9 +71,16 @@ int watch_main(int argc UNUSED_PARAM, char **argv) | |||
71 | 71 | ||
72 | // watch from both procps 2.x and 3.x does concatenation. Example: | 72 | // watch from both procps 2.x and 3.x does concatenation. Example: |
73 | // watch ls -l "a /tmp" "2>&1" - ls won't see "a /tmp" as one param | 73 | // watch ls -l "a /tmp" "2>&1" - ls won't see "a /tmp" as one param |
74 | #if ENABLE_PLATFORM_MINGW32 | ||
75 | cmd = NULL; | ||
76 | do { | ||
77 | cmd = xappendword(cmd, *argv); | ||
78 | } while (*++argv); | ||
79 | #else | ||
74 | cmd = *argv; | 80 | cmd = *argv; |
75 | while (*++argv) | 81 | while (*++argv) |
76 | cmd = xasprintf("%s %s", cmd, *argv); // leaks cmd | 82 | cmd = xasprintf("%s %s", cmd, *argv); // leaks cmd |
83 | #endif | ||
77 | 84 | ||
78 | period = parse_duration_str(period_str); | 85 | period = parse_duration_str(period_str); |
79 | width = (unsigned)-1; // make sure first time new_width != width | 86 | width = (unsigned)-1; // make sure first time new_width != width |