it easier to understand. Making it easy to understand isn't all that easy,
so litter the code with comments so some other poor soul can come along some
day and work on this if they see fit to do so. Avoid calling strlen(3) to
check for a nil-string, when we can just check for *str=='\0'.
Approved by: src/tools/regression/usr.bin/xargs/
same on Alpha and lint(1) pointed that out.
lint(1) on the same architecture pointed out how silly a cast to (u_int) to
malloc(3)'s argument was. Change that to size_t.
use of replstr and lack of Iflag), and add -R, which when given with
-I controls the number of arguments on which replacement will be done.
Some people happen to think it's idiotic to limit to 5 arguments, so
let the user override it if they like.
corrupt memory. Simplifies the code in one or two places, also removes some
code that looks like it was bogus or incomplete.
Update strnsubst to have one or two extra conditions which maybe would make
it more efficient, or at least more versatile. This is likely a no-op.
Merge xargs(1) with that of xMach.
Bring in xargs(1) changes to add -L and -I as per the Single Unix Specification
version 3. Proper exit status numbers are implemented, and the manual page has
been updated to reflect reality.
The code has been ANSIfied, and a new file has been added to xargs(1) to do the
substring substitution as SUSv3 requires.
Traditional behaviour should not be affected, use of -J should be deprecated
in favor of the more portable -I (though -J has been left, for now).
Submitted by: me, tjr (the exit status stuff)
Obtained from: xMach
fails, errno is saved to a volatile variable that the parent later inspects.
PR: bin/34898
Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au>
MFC after: 1 week
the data read from standard input at a specific point in the command
line arguments rather than at the end.
Submitted by: dd, gad
Reviewed by: gad, brian
and was also a bit inconsistent: leading blanks, or any double blanks
generated empty arguments, but a trailing blank did not.
PR: bin/2630, bin/10914
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
execvp() in the child branch of a vfork(). Changed to use fork()
instead.
Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.
PR: Loosely related to bin/8252
Approved by: jkh and bde
This fix only removes the dependency on compile time constants. The code
has other (old) problems that need to be addressed.
PR: 1791
Reviewed-by: bde, tegge