The -E argument to xargs does not work unless MALLOC_OPTIONS have been set to zero memory. Fix: Lines 293-298 of xargs.c (revision 1.55.2.1) The test at line 295 is testing the buffer currently being constructed with the -E option argument (eofstr). Since the buffer has not been NUL-terminated, this will only produce the correct answer by accident (indeed, it could run off and read unallocated memory if the -E string were long enough) *p should zapped before the compare is done, rather than at line 299. (Although I haven't traced through the execution path in full; I assume zapping *p at this point does no harm, but a full analysis is necessary.) 293: arg2: 294: foundeof = *eofstr != '\0' && 295: strcmp(argp, eofstr) == 0; 296: 297: /* Do not make empty args unless they are quoted */ 298: if ((argp != p || wasquoted) && !foundeof) { 299: *p++ = '\0'; How-To-Repeat: This should echo "one"): echo $'one\ntwo\nthree' | xargs -E two echo It works with MALLOC_OPTIONS=Z and fails with MALLOC_OPTIONS=J -bash-2.05b$ echo $'one\ntwo\nthree' | MALLOC_OPTIONS=J xargs -E two echo one two three -bash-2.05b$ echo $'one\ntwo\nthree' | MALLOC_OPTIONS=Z xargs -E two echo one
State Changed From-To: open->closed Checked in a fix, let me know if you experience any problems.