aboutsummaryrefslogtreecommitdiff
path: root/findutils/xargs.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
committerRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
commitead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch)
treeaf268270382dad969218063d4a8120fc91a9e631 /findutils/xargs.c
parent567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff)
parent64981b4c8e88812c322bee3832f1d421ff670ed5 (diff)
downloadbusybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'findutils/xargs.c')
-rw-r--r--findutils/xargs.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 71350d470..1f8d95168 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -83,9 +83,11 @@
83/* This is a NOEXEC applet. Be very careful! */ 83/* This is a NOEXEC applet. Be very careful! */
84 84
85 85
86//#define dbg_msg(...) bb_error_msg(__VA_ARGS__) 86#if 0
87#define dbg_msg(...) ((void)0) 87# define dbg_msg(...) bb_error_msg(__VA_ARGS__)
88 88#else
89# define dbg_msg(...) ((void)0)
90#endif
89 91
90#ifdef TEST 92#ifdef TEST
91# ifndef ENABLE_FEATURE_XARGS_SUPPORT_CONFIRMATION 93# ifndef ENABLE_FEATURE_XARGS_SUPPORT_CONFIRMATION
@@ -539,9 +541,18 @@ static char* FAST_FUNC process_stdin_with_replace(int n_max_chars, int n_max_arg
539 541
540 while (1) { 542 while (1) {
541 int c = getchar(); 543 int c = getchar();
544 if (p == buf) {
545 if (c == EOF)
546 goto ret; /* last line is empty, return "" */
547 if (c == G.eol_ch)
548 continue; /* empty line, ignore */
549 /* Skip leading whitespace of each line: try
550 * echo -e ' \t\v1 2 3 ' | xargs -I% echo '[%]'
551 */
552 if (ISSPACE(c))
553 continue;
554 }
542 if (c == EOF || c == G.eol_ch) { 555 if (c == EOF || c == G.eol_ch) {
543 if (p == buf)
544 goto ret; /* empty line */
545 c = '\0'; 556 c = '\0';
546 } 557 }
547 *p++ = c; 558 *p++ = c;