OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Fri Jan 25 00:19:27 2019 UTC (5 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, 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, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, HEAD
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

I am retiring my old email address;  replace it with my OpenBSD one.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Oct 28 07:22:59 2016 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.25: +5 -8 lines
Diff to previous 1.25 (colored)

Delete some useless setlocale(3) calls in /usr/bin, no functional change.
Patches from Jan Stary <hans at stare dot cz>, tweaked by me and tb@.
While here, apply some simple style improvements:
Sort headers, static void __dead usage(), return from main(),
zap case '?', drop /* NOTREACHED */, drop break after usage(), ...
OK tb@ millert@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jan 14 22:02:13 2016 UTC (8 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.24: +6 -8 lines
Diff to previous 1.24 (colored)

Check the return value of snprintf() for potential overflow instead
of doing a manual check beforehand.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jan 14 22:00:53 2016 UTC (8 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

Avoid potential read of one byte before the start of a malloc()ed
buffer.  From Max Fillinger.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 14 21:54:24 2016 UTC (8 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Use _PATH_DEFPATH if no PATH in the environment when invoked as which.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Dec 29 19:04:46 2015 UTC (8 years, 4 months ago) by gsoares
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

fix exit status on pledge(2) failure.

OK tb@ jsg@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Oct 10 19:02:19 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +4 -1 lines
Diff to previous 1.20 (colored)

pledge "stdio rpath"
ok beck doug

Revision 1.20 / (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_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Tue May 20 01:25:23 2014 UTC (10 years ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

ok jsing@ krw@ millert@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Apr 10 02:57:20 2013 UTC (11 years, 1 month ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.17: +3 -17 lines
Diff to previous 1.17 (colored)

Get the standard path from _PATH_STDPATH instead of
sysctl({CTL_USER,USER_CS_PATH}).  Expand that into the manpage
too.

_PATH_STDPATH suggested by miod@
Corrections from schwarze@ and jmc@
ok millert@ miod@ schwarze@ jmc@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Mar 11 04:30:21 2011 UTC (13 years, 2 months ago) by guenther
Branch: MAIN
CVS Tags: 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
Changes since 1.16: +9 -9 lines
Diff to previous 1.16 (colored)

The -a option shouldn't change the exit status
Patch from David Julio (david.a.julio at gmail.com)

Revision 1.16 / (download) - annotate - [select for diffs], Mon May 31 14:01:49 2010 UTC (13 years, 11 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

stderr should be used for error messages; this diff makes which(1)
output not only more standard but also more predictable, as it now
matches the behavior of the csh(1)'s built-in command.

diff from Tobias Ulmer.

ok millert@

Revision 1.15 / (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.14: +1 -5 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Tue Aug 14 17:41:10 2007 UTC (16 years, 9 months ago) by sobrado
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, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

the ellipsis is not an optional argument; document the "-a" flag in whereis(1)

help and feedback by jmc@ and otto@

ok deraadt@, jmc@ and otto@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Sep 24 19:45:27 2004 UTC (19 years, 7 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.12: +5 -3 lines
Diff to previous 1.12 (colored)

save a copy of the pointer before strsep; fixes an abort on free.
ok by millert, otto & pedro.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Sep 23 17:44:47 2004 UTC (19 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.11: +13 -10 lines
Diff to previous 1.11 (colored)

Add missing free on error; Alison Winters
Also KNF the return statements and make usage() __dead while I am here.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 17 21:56:26 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.10: +9 -9 lines
Diff to previous 1.10 (colored)

Sync with share/misc/license.template and add missing DARPA credit
where applicable.

Revision 1.10 / (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.9: +3 -3 lines
Diff to previous 1.9 (colored)

mostly ansi cleanup; pval ok

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 3 01:52:41 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.8: +12 -23 lines
Diff to previous 1.8 (colored)

Use an ISC-tyle license for all my code; it is simpler and more permissive.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Apr 4 03:25:28 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.7: +5 -13 lines
Diff to previous 1.7 (colored)

snprintf() is simpler than multiple strlcpy() and manual fiddling.
Also convert to C89 while I'm at it.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Apr 4 00:42:34 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

snprintf & strlcpy; tedu ok

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:59 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.5: +4 -4 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Sun Jun 21 22:14:05 1998 UTC (25 years, 11 months ago) by millert
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.4: +3 -6 lines
Diff to previous 1.4 (colored)

Remove the advertising clause in my old license, it impedes free use
of the code as a large number of similar clauses makes it impossible
to write an ad for a product using the code...

Revision 1.4 / (download) - annotate - [select for diffs], Thu May 7 19:12:20 1998 UTC (26 years ago) by deraadt
Branch: MAIN
Changes since 1.3: +10 -10 lines
Diff to previous 1.3 (colored)

fix err() use

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jan 28 17:18:53 1998 UTC (26 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.2: +19 -13 lines
Diff to previous 1.2 (colored)

Add -a flag.  Idea from bgrayson@ece.utexas.edu

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 8 02:44:07 1997 UTC (27 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.1: +48 -11 lines
Diff to previous 1.1 (colored)

which(1) and whereis(1) are now the same program (hard linked).

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 21 18:35:00 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN

which(1) is now a binary that works in any shell since csh(1) has a
which built-in.

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.