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
(cherry picked from commit f058359ba5e08c555d7e6f192217f890b83cd46c)
xargs: fix description of strnsubst return value
Reported by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574
(cherry picked from commit 1e692b938e37a9b43a43ace2739eb6b97379cac0)
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
(cherry picked from commit 21ef48af5c0f4ed85a5f42855b5a8d58b5431103)
xargs: Fix typo in error message.
MFC after: 1 week
Sponsored by: Klara, Inc.
(cherry picked from commit 6d777389e19d3bebde515e88e8405de45d8af7bd)
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
(cherry picked from commit fbc445addf9183d180bb8b488281617bb19d9242)