OpenBSD CVS

CVS log for src/usr.bin/xargs/xargs.c


[BACK] Up to [local] / src / usr.bin / xargs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.38 / (download) - annotate - [select for diffs], Sat Dec 23 15:58:58 2023 UTC (4 months, 3 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.37: +7 -3 lines
Diff to previous 1.37 (colored)

Suppress a spurious empty arg at EOF w/ "find -0" caused by the last commit.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 22 17:12:13 2023 UTC (4 months, 3 weeks ago) by millert
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

xargs: fix parsing of empty fields when "xargs -0" is used.
Previously, these fields would be skipped.  From Hiltjo Posthuma.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Dec 4 23:50:50 2022 UTC (17 months, 2 weeks ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.35: +2 -3 lines
Diff to previous 1.35 (colored)

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@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Jul 19 13:19:25 2020 UTC (3 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.34: +12 -24 lines
Diff to previous 1.34 (colored)

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.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jun 12 15:24:31 2018 UTC (5 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Use sizeof(char *) not sizeof(char **) when allocating an array
of strings with calloc(3).  From David CARLIER.  OK tb@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Oct 16 13:10:50 2017 UTC (6 years, 7 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Favor memmove() over memcpy() since dst and src originates from the same
allocation and may therefore overlap.

ok deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 19 17:08:41 2017 UTC (7 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.31: +11 -4 lines
Diff to previous 1.31 (colored)

Fix -L/-I processing in -0 mode so that NUL-delimited entries are
treated as "lines".  From FreeBSD.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Dec 9 19:29:49 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.30: +3 -5 lines
Diff to previous 1.30 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.30 / (download) - annotate - [select for diffs], Sat Oct 10 15:52:30 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +5 -1 lines
Diff to previous 1.29 (colored)

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

Revision 1.29 / (download) - annotate - [select for diffs], Sat Apr 18 18:28:38 2015 UTC (9 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.28: +15 -7 lines
Diff to previous 1.28 (colored)

Convert many atoi() calls to strtonum(), adding range checks and failure
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:14 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

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)

Revision 1.27 / (download) - annotate - [select for diffs], Thu Mar 25 01:03:57 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.26: +20 -9 lines
Diff to previous 1.26 (colored)

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@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:50 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.25: +1 -15 lines
Diff to previous 1.25 (colored)

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

Revision 1.25 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:36 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.24 / (download) - annotate - [select for diffs], Tue Nov 1 04:52:59 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

spacing

Revision 1.23 / (download) - annotate - [select for diffs], Mon Sep 26 20:32:04 2005 UTC (18 years, 7 months ago) by fgsch
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

terminate the buffer before calling regexec(3) when prompting for
confirmation. fixes a crash with malloc options; otto@ ok.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Sep 12 09:44:59 2005 UTC (18 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

- add -r to usage()
- the description of -p uses `maxprocs' as the arg identifier,
as does usage(), so use it in SYNOPSIS too;

Revision 1.21 / (download) - annotate - [select for diffs], Sat Sep 10 23:00:29 2005 UTC (18 years, 8 months ago) by brad
Branch: MAIN
Changes since 1.20: +10 -4 lines
Diff to previous 1.20 (colored)

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@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jun 20 18:52:19 2005 UTC (18 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.19: +6 -8 lines
Diff to previous 1.19 (colored)

KNF

Revision 1.19 / (download) - annotate - [select for diffs], Mon Aug 23 19:09:36 2004 UTC (19 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.18: +7 -12 lines
Diff to previous 1.18 (colored)

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.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Aug 15 22:46:46 2003 UTC (20 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.17: +6 -6 lines
Diff to previous 1.17 (colored)

Fix typo (errx vs. err) for malloc failures; Andrey Matveev

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 15 23:30:47 2003 UTC (20 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.16: +10 -6 lines
Diff to previous 1.16 (colored)

can't use err after vfork.  ok millert

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jun 13 16:54:00 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Close correct fd after dup2(); Maxime Henrion

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jun 12 01:15:53 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Add the -o option to the getopt() string; missed in last commit.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jun 12 01:09:23 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.13: +443 -157 lines
Diff to previous 1.13 (colored)

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.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:54 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +8 -10 lines
Diff to previous 1.12 (colored)

mostly ansi cleanup; pval ok

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:24 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -7 lines
Diff to previous 1.11 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Feb 18 18:22:54 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.10: +2 -5 lines
Diff to previous 1.10 (colored)

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.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:59 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

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.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:18 2001 UTC (22 years, 6 months ago) by mpech
Branch: MAIN
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

kill more registers

millert@ ok

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jun 23 00:22:58 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.7: +6 -3 lines
Diff to previous 1.7 (colored)

use sysconf() to get ARG_MAX

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 26 17:12:48 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.6: +8 -8 lines
Diff to previous 1.6 (colored)

indent

Revision 1.6 / (download) - annotate - [select for diffs], Tue Nov 4 08:47:15 1997 UTC (26 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.5: +11 -3 lines
Diff to previous 1.5 (colored)

use sys_signame to print the signal info; cgd

Revision 1.5 / (download) - annotate - [select for diffs], Fri Sep 12 01:47:25 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

s/;;/;/

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jan 15 23:43:40 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

getopt(3) returns -1 when out of args, not EOF, whee!

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 26 05:44:03 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

rcsid

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jun 11 06:48:06 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +18 -5 lines
Diff to previous 1.1 (colored)

add -0 option, written by me

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:47:00 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:47:00 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.