History log of /freebsd-current/usr.bin/xargs/xargs.c
Revision Date Author Comments
# 5fbdcd65 19-Apr-2024 Martin Tournoij <martin@arp242.net>

xargs: use getline() instead of fgetln()

This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from: https://github.com/dcantrell/bsdutils and
https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# eab91d00 13-Jul-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

xargs: Prevent overflow in linelen calculation if nargs is large.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41023


# 1048a870 13-Jul-2023 Daniel Tameling <tamelingdaniel@gmail.com>

xargs: disallow -R0 and -L0

Both cases were interpreted as these flags are unset. This meant that
-R0 got converted to -R5 and that -L0 didn't have any effect at all.
Since make at most 0 replacements isn't useful and since call utility
for every 0 lines read doesn't make sense, throw an error for these
two cases.

MFC after: 1 week
Reviewed by: des, kevans
Differential Revision: https://reviews.freebsd.org/D41022


# 202adb22 13-Jul-2023 Daniel Tameling <tamelingdaniel@gmail.com>

xargs: fix -R so that it accepts negative numbers again

fbc445addf9 converted the parsing of arguments to strtonum but made
the accepted range for -R too restrictive. As documented in the man
page, it should accept negative numbers.

Added a test for this, which was provided by Jose Luis Duran.

Fixes: fbc445addf9
MFC after: 1 week
Reviewed by: des, kevans
Differential Revision: https://reviews.freebsd.org/D41021


# fbc445ad 05-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

xargs: Consistently use strtonum() to parse arguments.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40425


# 6d777389 05-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

xargs: Fix typo in error message.

MFC after: 1 week
Sponsored by: Klara, Inc.


# 21ef48af 17-Apr-2023 Yuri Pankov <yuripv@FreeBSD.org>

xargs: improve foundeof check for -E

4aeb63826e0f got it almost correct (we can't use strcmp() here as
current argument isn't guaranteed to be NUL-terminated), but we also
need to check that current argument length is equal to that of eofstr.

PR: 270867
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D39583


# 0ca740d9 15-Oct-2022 liu-du <duliujimmy@hotmail.com>

xargs: fix exit code when using -P

currently when xargs runs in parallel mode (e.g. -P2), it somtimes
incorrectly returns zero exit code. this commit fix it and also adds
tests.

Reviewed by: mjg
PR: 267110


# f058359b 05-Jul-2022 Tom Jones <thj@FreeBSD.org>

xargs: terminate if line replacement cannot be constructed

If the line with replacement cannot be constructed xargs should
terminate as documented in the man page

We encounter this error, but gnu/xargs doesn't because they have a much
larger limit for created outputs (~10000 lines).

Reviewed by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574


# 0d2dcf21 12-Dec-2020 Yuri Pankov <yuripv@FreeBSD.org>

xargs: compile yesexpr as ERE

yesexpr is an extended regular expression for quite some time now,
use appropriate flag when compiling it.

PR: 238762
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D27509


# dc940832 21-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

xargs: add some long options for GNU compatibility

These are low-effort to add, so let's just do it.

Reported by: "LukeShu" on Hacker News (-r / --no-run-if-empty)
MFC after: 1 week


# ab825606 03-Apr-2020 Mark Johnston <markj@FreeBSD.org>

xargs: Fix exit status expression when a child process fails to exec.

PR: 244327
Submitted by: thomas.duffy.99@alumni.brown.edu
MFC after: 1 week


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# c9e1c304 29-Dec-2015 Ulrich Spörlein <uqs@FreeBSD.org>

Fix type mismatches for malloc(3) and Co.

This is rather pedantic, as for most architectures it holds that
sizeof(type *) == sizeof(type **)

Found by: clang static analyzer
Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D4722


# c782f6f0 08-Aug-2015 Allan Jude <allanjude@FreeBSD.org>

fix regression in xargs -Px (introduced in r286289) and add regression tests

PR: 202152
Submitted by: jbeich (original), Nikolai Lifanov (final)
Reviewed by: jbeich
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D3330


# e896b4a4 04-Aug-2015 Allan Jude <allanjude@FreeBSD.org>

xargs now takes -P0, creating as many concurrent processes as possible

PR: 199976
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Reviewed by: mjg, bjk
Approved by: bapt (mentor)
MFC after: 1 month
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2616


# cffa7aa6 14-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Convert atoi(3) to stronum(3) which allows to arguments and report proper errors
to the users

Obtained from: OpenBSD


# a274be77 09-May-2013 Eitan Adler <eadler@FreeBSD.org>

Style(9) changes fo xargs.c


# 70945890 16-Mar-2012 Jilles Tjoelker <jilles@FreeBSD.org>

xargs: Before exiting, wait for all invocations of the utility.

This only has an effect with -P, otherwise errors are only detected when the
utility is not running.

Submitted by: Matthew Story


# 6e795141 26-Feb-2012 Jilles Tjoelker <jilles@FreeBSD.org>

xargs: Remove an unclear comment that only tried to repeat what the code did

Reported by: bde


# c15adc89 26-Feb-2012 Jilles Tjoelker <jilles@FreeBSD.org>

xargs: Fix comma splice in error message.

Reported by: bde


# 23583c4f 23-Feb-2012 Jilles Tjoelker <jilles@FreeBSD.org>

xargs: If a utility exits with 255 or a signal, write an error message.

If a utility called by xargs exits with status 255 or because of a signal,
POSIX requires writing an error message.

PR: 165155
Submitted by: Matthew Story matthewstory gmail com


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 29afe03f 21-Nov-2010 Stephen McKay <mckay@FreeBSD.org>

Various syntactic tweaks to satisfy style(9). No change to execution.

Submitted by: gcooper@


# 92095ab6 21-Nov-2010 Stephen McKay <mckay@FreeBSD.org>

xargs can be fooled by exiting children that it did not start, causing
it to kick off a new command before the previous has finished, resulting
in corrupted (interleaved) output. It is also fooled by non-exiting
children it did not start, failing to exit until all extraneous children
have exited.

This patch makes xargs keep track of children it starts, ignoring
pre-existing ones.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# b65bc267 01-Jan-2006 Juli Mallett <jmallett@FreeBSD.org>

NUL terminate buffer from fgetln(3). From fgsch@OpenBSD.


# f22bf180 01-Jan-2006 Juli Mallett <jmallett@FreeBSD.org>

Whitespace after switch.

Inspired by: OpenBSD


# 4aeb6382 31-Dec-2005 Juli Mallett <jmallett@FreeBSD.org>

Check the entire length of the current argument for the EOF string with -E,
but don't expect a proper ASCII string to exist right here right now, don't
use strcmp(3) which checks for a NUL. As we're still building the argument
up, the next character might be garbage. It would probably be just as safe to
temporarily write a NUL there, but if we've reached the end of argument memory
that might not be the best idea, I think. It's unclear.

Doing it this way seems to meet the most with the original intent.

PR: 85696
Prodded by: stefanf


# ba084f6a 30-Dec-2005 Juli Mallett <jmallett@FreeBSD.org>

Add a FreeBSD-specific -S flag which controls the maximum size of an argument
having replacements done in it via -I.


# 2d14e0e5 06-Dec-2005 Dag-Erling Smørgrav <des@FreeBSD.org>

Add -r option for GNU compatibility.

MFC after: 2 weeks


# 46793db9 26-Feb-2005 Garance A Drosehn <gad@FreeBSD.org>

MFC 1.22: Fix -0 vs -L/-I processing, mainly so that 'xargs -0 -I []' will
do something sensible (namely: treat then '\0' as the EOL character, when
deciding what "a line" is for -N). Note that -I implies -N.

MFC after: 3 days


# f58b94cb 11-Jul-2004 Tim J. Robbins <tjr@FreeBSD.org>

Call setlocale() with category LC_ALL instead of LC_MESSAGES. We need
LC_CTYPE and LC_COLLATE to correctly interpret regular expressions
returned by nl_langinfo(YESEXPR), and it doesn't hurt to include the
rest.


# 0792992c 13-Jun-2003 Maxime Henrion <mux@FreeBSD.org>

- Use _PATH_TTY and _PATH_DEVNULL macros.
- Don't fail if we can't open /dev/null since this can happen if
xargs is jail'ed or chroot'ed.

These fixes were submitted by Todd Miller from the OpenBSD project.
There was one problem in those fixes that broke -o, which is corrected
here and should be committed to the OpenBSD repo by Todd soon.

MFC in: 3 days


# 004bd28e 13-Jun-2003 Juli Mallett <jmallett@FreeBSD.org>

Use waitpid, instead of wait3, which is more portable.

Submitted by: "Todd C. Miller" <Todd.Miller@courtesan.com>
Obtained from: OpenBSD
Reviewed by: tjr


# 815e414e 13-Jun-2003 Juli Mallett <jmallett@FreeBSD.org>

Remove redundant return; from void function.

Submitted by: "Todd C. Miller" <Todd.Miller@courtesan.com>
Obtained from: OpenBSD


# 8eb2a3de 03-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Don't shaddow exp(3).


# 30aaff11 05-Apr-2003 Warner Losh <imp@FreeBSD.org>

Migrate to a new way of dealing with building from old revisions of
FreeBSD. This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build). We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files. We then include this directory when building host binaries.

This removes all the past release compatibilty hacks from various
places in the tree. We still build on tip of stable and current. I
will work with those that want to support more, although I anticipate
it will just work.

Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.


# 76d94537 03-Apr-2003 Warner Losh <imp@FreeBSD.org>

Simplify compatibility ifdef.


# cec1ba8c 28-Mar-2003 Maxime Henrion <mux@FreeBSD.org>

When -o isn't specified, open /dev/null as stdin.

Suggested by: jhb


# 98186e89 23-Mar-2003 Maxime Henrion <mux@FreeBSD.org>

Add a new -o option to tell xargs(1) to reopen /dev/tty as stdin in
the child process, before executing the command. This is very useful
when you do stuff like ``find ... | xargs interactive_application''.
Without -o, the application would inherit the pipe as its stdin, and
you thus lose any control over it.

This flag has been carefully chosen to not conflit with other options
of other xargs utilities like GNU xargs.

Reviewed by: jmallett


# 3c675167 26-Feb-2003 Juli Mallett <jmallett@FreeBSD.org>

Extend our -R extension which sets the number of arguments in which -I will
replace to support magic values less than zero, which mean to just go nuts
and expand as many as we want.

MFC after: 2 weeks


# 08f16c7a 26-Feb-2003 Juli Mallett <jmallett@FreeBSD.org>

De-typo usage string.


# 330d23f5 21-Dec-2002 Tim J. Robbins <tjr@FreeBSD.org>

Add the -P option which executes multiple copies of the specified utility
in parallel. Idea from GNU xargs.


# 40c6b893 13-Nov-2002 Ruslan Ermilov <ru@FreeBSD.org>

Take __FreeBSD_version into account when BOOTSTRAPPING.


# 2b239dd1 11-Aug-2002 Jens Schweikhardt <schweikh@FreeBSD.org>

Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by: bde
MFC after: 3 days


# 99a84ce1 30-Jun-2002 Tim J. Robbins <tjr@FreeBSD.org>

Declare environ as char **environ like in environ(7), not char *environ[].
This corrects a problem whereby xargs could not walk the environment table
to count the amount of space it used, and treated it as if it were empty.
This problem was introduced in rev 1.15.

MFC after: 2 days


# 1926d4aa 21-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Stylistic nit:

main()'s argv argument is char*[], and functions that may inherit that arg
should use char*[] as well.


# 51f7a48b 03-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Err, duh, free(3) doesn't set its argument to NULL... Fix realloc of a freed
chunk.


# 6ea89183 30-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Restructure sanity checks so that -I and -J just override eachother, rather
than triggering a usage(). Allow -R and -I to be specified in any order, and
thus change how -R checks for -I not being given and triggering a usage().

Partially requested by: gad


# 986d829b 30-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Allow the input line to be NULL, and teach strnsubst() that NULL means to use
a nil-string.


# be70f7d4 17-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Simplify prerun() in the case where there are no arguments. Can't do -I or -J
substitution if `utility' is not specified and we're using the buildin echo;
It has no arguments for us to abuse.


# 8e0a87c1 10-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

xargs.c,v 1.33 broke the upgrade path from old versions of 4.x and 5.0.


# b23de8a3 05-May-2002 Juli Mallett <jmallett@FreeBSD.org>

-I and -J both set the same variable, replstr, to the string to replace with
a line of input, and both work differently, so prevent them from both being
passed to xargs(1).


# 305e39f4 05-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Modify the -p implementation to use a user's locale, so they can respond to
the prompt in their native language.

Also make the prompt fit what POSIX asks for (?...).

This should not affect use of -p with yes(1) [as every locale I know of matches
'y' as YESEXPR as well], but that's what -t is for anyway. -p is meant to be
really used interactively.

Submitted by: tjr, jmallett


# 5eb40323 04-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Fix a typo.

Submitted by: Carl Schmidt <cschmidt@slackerbsd.org>

Wrap an obscenely long line while I'm here.


# 91045075 04-May-2002 Juli Mallett <jmallett@FreeBSD.org>

In an effort to make this utility easier to work with at a source level, move
out the parse loop to a seperate function, and move local variables around as
is needed. To keep the state of some variables and keep from having huge arg
lists to functions, make a bunch global.

Change use of err(3) in situations where malloc(3) will be setting errno to
errx(3) since assuming malloc(3) sets errno is non-portable, and provides no
more useful information in the context of FreeBSD.

Submitted by: bde (err/errx), Carl Schmidt <cschmidt@slackerbsd.org> (some
of the movement of the input loop to a function)
Approved by: src/tools/regression/usr.bin/xargs


# 9bf450b8 04-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Grouping changes.

Submitted by: Carl Schmidt <cschmidt@slackerbsd.org>


# 3dca1afc 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Don't use pointers as booleans.


# b6594dba 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Replace calloc(3) with malloc(3), and set the tail of the
argument list to NULL, to terminate the arguments passed
to execvp(2).

Thanks to: bde (for pointing out some missing parens)

And with apologies to Ozzy Osbourne:

On his way to dinner
It took him by surprise
When an email from bde
Said his code was full of lies

Style (indentation)
And his bracing were all wrong
He casted to size_t
When he should have cast to long

I don't mind

Single letter identifiers
Unwrapped Line
Over 80 chars
Far over 80 chars

Who can we get to send diffs
We need Bruce D. Evans
Shows you comparason to his
We need Bruce D. Evans again


# 263dc775 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Move substitution out to a function, prerun(), and replace use of run() with
it. It handles everything (right now) that needs done before run(), except
the -J case, because while that would be easy, I don't quite understand -J.

Reviewed by: src/tools/regression/usr.bin/xargs


# b9b03ba0 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Get rid of bogus holder for realloc(3).


# 1925cb24 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Rewrite the loop that handles substitution in the -I case, and try to make
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/


# 4f49da74 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Rename `lflag' to `Lflag' to match the option's case.


# d7a43b24 03-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Revert revision 1.22. I incorrectly modified the Berkeley identifiers.

Requested by: bde, mike


# eee11f05 01-May-2002 Juli Mallett <jmallett@FreeBSD.org>

__COPYRIGHT() and __SCCSID().


# 76ccb81e 01-May-2002 Juli Mallett <jmallett@FreeBSD.org>

An explicit cast to size_t for an inline integer, since the two are not the
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.


# b50a7286 01-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Make -J a proper flag internal to the code (rather than just check for
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.


# 0fa5e8dc 01-May-2002 Juli Mallett <jmallett@FreeBSD.org>

Rework some of the -I support so I can't find a way to make xargs(1) core or
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.


# 91ae52cb 19-Apr-2002 Juli Mallett <jmallett@FreeBSD.org>

In the case where we can't open /dev/tty, fall back to -t behaviour.

Submitted by: fenner


# 0c7c579b 19-Apr-2002 Juli Mallett <jmallett@FreeBSD.org>

Compound two fprintf(3)s into 1 using string concatenation.


# fc17b349 19-Apr-2002 Juli Mallett <jmallett@FreeBSD.org>

After 3 months...

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


# 73385ac6 15-Mar-2002 Juli Mallett <jmallett@FreeBSD.org>

ANSIfy: Function declarations and prototypes, use of environ(7).

Reviewed by: mike
Approved by: mike


# 8ad749a4 09-Mar-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Change back to using vfork() now that execvp() is vfork()-safe. If execvp()
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


# 06469209 07-Mar-2002 Mike Barcroft <mike@FreeBSD.org>

Leave the `copyright' variable exposed, since the main purpose of it
is to put a copyright in the object file.

Submitted by: bde


# 51883012 04-Mar-2002 Mike Barcroft <mike@FreeBSD.org>

Fix vendor ID (mostly obtained from Rev 1.1).


# 16b07a33 11-Dec-2001 Mark Murray <markm@FreeBSD.org>

WARNS=2 fixes, remove register keyword, use __FBSDID()


# 8d904f15 14-May-2001 Dima Dorfman <dd@FreeBSD.org>

Add a -J replstr option that allows the user to tell xargs to insert
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


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# ef9866be 23-May-1999 Jean-Marc Zucconi <jmz@FreeBSD.org>

xargs was spliting the input in a very different way from everyone else,
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>


# 1fd98d7d 13-Oct-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
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


# a3e5bc4f 16-Jun-1998 Joseph Koshy <jkoshy@FreeBSD.org>

Remove compile time dependency on ARG_MAX.

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


# a51024e2 27-Aug-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3) instead of local redefinition.


# 1c8af878 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# d9198881 01-Nov-1996 Warner Losh <imp@FreeBSD.org>

Reviewed by: Warner Losh <imp@village.org>
Submitted by: Marc Slemko <marcs@znep.com>
Obtained from: OpenBSD

Add -0 for reading the results of find -0.


# e5009da0 05-Mar-1996 Satoshi Asami <asami@FreeBSD.org>

Make xargs take into account the bytes occupied by the environment.

Original by: peter


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources