freebsd-src/usr.bin/xargs
Daniel Tameling 15991a6824 xargs: fix -R so that it accepts negative numbers again
fbc445addf 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:		fbc445addf
MFC after:	1 week
Reviewed by:	des, kevans
Differential Revision:	https://reviews.freebsd.org/D41021

(cherry picked from commit 202adb2236)

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

(cherry picked from commit 1048a870e3)

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

(cherry picked from commit eab91d0081)

xargs: Fix test case count.

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

(cherry picked from commit c65845d0bb)

xargs: Install missing test output.

Fixes:		eab91d0081
MFC after:	1 week
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D41033

(cherry picked from commit d234c8228c)

xargs tests: Disable the test added in commit eab91d0081

This test has been triggering OOM kills in CI runs since it triggers an
allocation of 16GB.  Temporarily disable the test until the problem is
solved one way or another.

(cherry picked from commit 2682a15527)
2023-09-07 10:56:26 +02:00
..
tests xargs: fix -R so that it accepts negative numbers again 2023-09-07 10:56:26 +02:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
pathnames.h
strnsubst.c
xargs.1 Remove $FreeBSD$: one-line nroff pattern 2023-08-23 11:43:32 -06:00
xargs.c xargs: fix -R so that it accepts negative numbers again 2023-09-07 10:56:26 +02:00