millert
d1526e1c2b
Suppress a spurious empty arg at EOF w/ "find -0" caused by the last commit.
2023-12-23 15:58:58 +00:00
millert
dffc24ecb5
xargs: fix parsing of empty fields when "xargs -0" is used.
...
Previously, these fields would be skipped. From Hiltjo Posthuma.
2023-12-22 17:12:13 +00:00
jsg
6bae335dd0
remove duplicate includes
2023-04-19 12:58:15 +00:00
cheloha
d7259957e8
userspace: remove vestigial '?' cases from top-level getopt(3) loops
...
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument. We can
handle this case with the "default" failure case with no loss of
legibility. Hence, remove all the redundant "case '?':" lines.
Prompted by dlg@. With help from dlg@ and millert@.
Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
2022-12-04 23:50:45 +00:00
schwarze
d3a07ef22e
Delete support for LC_MESSAGES which we shall never implement.
...
This nicely simplifies the code, deleting three header inclusions
and calls to various complicated library functions.
Dead code reported by Jan Stary <hans at stare dot cz>.
Garbage collect pointless (void) casts and a .Tn macro while here.
Tweaks and OK martijn@, OK millert@ and kn@ on an earlier version.
2020-07-19 13:19:25 +00:00
deraadt
515e489c3d
snprintf/vsnprintf return < 0 on error, rather than -1.
2019-07-03 03:24:01 +00:00
millert
b59d868931
Use sizeof(char *) not sizeof(char **) when allocating an array
...
of strings with calloc(3). From David CARLIER. OK tb@
2018-06-12 15:24:31 +00:00
anton
79ef740f1b
Favor memmove() over memcpy() since dst and src originates from the same
...
allocation and may therefore overlap.
ok deraadt@
2017-10-16 13:10:50 +00:00
millert
720942423e
Fix -L/-I processing in -0 mode so that NUL-delimited entries are
...
treated as "lines". From FreeBSD.
2017-01-19 17:08:41 +00:00
tedu
cb3284a8d3
remove unused variable repllen.
...
i tried to see if it could be useful, but this function is kinda crazy.
from Julien Ramseier
2017-01-03 21:47:37 +00:00
mmcc
b711046028
Remove NULL-checks before free(). ok tb@
2015-12-09 19:29:49 +00:00
deraadt
f02859560d
pledge "stdio rpath proc exec". proc & exec because obviously it
...
spawns subprocesses. rpath is only needed for the -o (open /dev/tty)
or no -o (open /dev/null) choice.
ok beck
2015-10-10 15:52:30 +00:00
deraadt
a47b6461a1
Convert many atoi() calls to strtonum(), adding range checks and failure
...
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-04-18 18:28:36 +00:00
deraadt
b9fc9a728f
Replace <sys/param.h> with <limits.h> and other less dirty headers where
...
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
jmc
513e4edf36
IL are marked xsi;
2014-06-04 06:48:33 +00:00
jmc
73d4fc9bd5
no longer any need to quote macro lines with >9 args;
...
From: Jan Stary
2013-08-14 06:32:26 +00:00
jmc
f1c64ac4de
add an EXIT STATUS section for /usr/bin;
2010-09-03 11:09:28 +00:00
schwarze
b7f5ef4233
Regarding -L, consider a line ending in unescaped white space and the next
...
non-empty line to form one single line, as required by XPG 4.
While here, use isblank(3) to identify white space instead of assuming
that only blank and tab are white space characters.
Geoff Clare <gwc at opengroup dot org> agrees that the standard for -L
should say "A line is considered to end with the first <newline>
unless the last character of the line is an *unescaped* <blank>;
an *unescaped* trailing <blank> signals continuation to the next
non-empty line, inclusive." The word *unescaped* is missing from
the standard, but we regard that as a goof in the standard.
Bug noticed by, much feedback from, and "should go in now" guenther@
2010-03-25 01:03:57 +00:00
schwarze
fe37b92a6f
xargs -I and -L are XPG4, not POSIX; ok jmc@
2010-02-04 23:12:48 +00:00
deraadt
043fbe51c1
rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
...
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
sobrado
d9f1e4116e
use the UNIX-related macros (.At and .Ux) where appropriate.
...
ok jmc@
2009-10-22 12:35:53 +00:00
jmc
99332e389a
bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a few
...
updates to follow;
2009-02-08 17:15:08 +00:00
deraadt
1ed98fdf61
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
2007-09-02 15:19:07 +00:00
jmc
9490d37cb6
convert to new .Dd format;
2007-05-31 19:19:00 +00:00
jmc
7c5a075bb3
- use a consistent text for STANDARDS
...
- note which options are extensions to POSIX
2007-05-30 04:41:33 +00:00
jmc
3d6cdda9b5
a variation of netbsd -r1.18:
...
PR/34182 from der Mouse -- clarify -0 option
2006-08-12 07:10:56 +00:00
bernd
e5522f80ec
Use 'cp -R' instead of 'cp -r' in the example of the -J option.
...
ok jmc@
2006-07-24 14:43:59 +00:00
otto
ca45f1c74b
Put commas in right places, from Ray Lai.
2006-02-14 15:05:11 +00:00
otto
22fa73245d
Document that -0 is an non-standard extension (sad but true).
...
ok millert@
2006-02-14 12:18:21 +00:00
cloder
1406f66425
lint makes it easy to find these really bad ones, like size_t n = snprintf
2005-12-01 05:52:20 +00:00
deraadt
ec017aef6a
spacing
2005-11-01 04:52:58 +00:00
fgsch
39c003f832
terminate the buffer before calling regexec(3) when prompting for
...
confirmation. fixes a crash with malloc options; otto@ ok.
2005-09-26 20:32:04 +00:00
jmc
95f3f4b1be
- add -r to usage()
...
- the description of -p uses `maxprocs' as the arg identifier,
as does usage(), so use it in SYNOPSIS too;
2005-09-12 09:44:59 +00:00
brad
3e7336d9d7
Make xargs run [utility] program even when zero arguements are provided,
...
makes xargs POSIX compliant.
Original diff from jason@, better diff provided by millert@
Resolves PR 4262
ok deraadt@ millert@
2005-09-10 23:00:29 +00:00
millert
8301535968
KNF
2005-06-20 18:52:19 +00:00
millert
3ba002a308
Make behavior if the utility was not found or could not be executed
...
match the documentation. The old code was making assumptions about
how vfork() is implemented which are not valid on OpenBSD.
From Jason Ish.
2004-08-23 19:09:36 +00:00
millert
9cc9026499
Fix typo (errx vs. err) for malloc failures; Andrey Matveev
2003-08-15 22:46:46 +00:00
tedu
87fdc3ff45
can't use err after vfork. ok millert
2003-07-15 23:30:47 +00:00
millert
927153e1c8
Close correct fd after dup2(); Maxime Henrion
2003-06-13 16:54:00 +00:00
jmc
79d3821986
tweak;
...
ok millert@
2003-06-12 17:55:01 +00:00
millert
b2ee86d43e
Check snprintf rval for -1
2003-06-12 03:23:22 +00:00
millert
80ae0c808f
Add the -o option to the getopt() string; missed in last commit.
2003-06-12 01:15:53 +00:00
millert
b508e5c5c7
Sync with FreeBSD's xargs plus some fixes by me. This makes us
...
POSIX-compliant and adds some useful extensions. Most of the work
in FreeBSD was done by jmallett.
2003-06-12 01:09:22 +00:00
deraadt
1837a5ca50
mostly ansi cleanup; pval ok
2003-06-10 22:20:44 +00:00
millert
f75387cb26
Remove the advertising clause in the UCB license which Berkeley
...
rescinded 22 July 1999. Proofed by myself and Theo.
2003-06-03 02:56:05 +00:00
millert
39aee76eea
Don't require the -n flag if -x is specified. This is consistent with
...
the manual page as well as xargs on other operating systems.
2002-02-18 18:22:54 +00:00
millert
c72b5b24e1
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2002-02-16 21:27:05 +00:00
mpech
c0932ef1ff
kill more registers
...
millert@ ok
2001-11-19 19:02:13 +00:00
aaron
f1ba34738e
Change all option list specifications to ".Bl -tag -width Ds". Most man
...
pages just needed their -width parameter tweaked to "Ds", which provides
a nice width of 6 constant characters. For consistency more than anything.
2000-11-09 17:51:53 +00:00
aaron
43b6428b7b
Finish off cleanup usr.bin/ man pages.
2000-03-14 14:58:24 +00:00