Home | History | Annotate | Download | only in gen
History log of /src/lib/libc/gen/basename.c
RevisionDateAuthorComments
 1.12  18-Jan-2023  simonb KNF nit: opening brace of a function on next line.
 1.11  16-Jul-2014  christos basename_r and dirname_r are non-standard and different from what we define
here on FreeBSD. Their libgen.h exposes them unconditionally, so hide ours
for now.
 1.10  14-Jul-2014  christos Factor out the basename and dirname code into basename_r and dirname_r
which are static for now. Inspired by similar changes to android(bionic).
 1.9  24-Nov-2009  tnozaki branches: 1.9.12; 1.9.22;
guard single-dot from modification by the application
(SUSv3 spec don't forbid this brutal operation).
this idea taken from OpenBSD's version of basename(3) and dirname(3).
 1.8  10-May-2008  christos branches: 1.8.6;
undo the constification of the argument. Per opengroup.
 1.7  28-Apr-2008  martin branches: 1.7.2;
Remove clause 3 and 4 from TNF licenses
 1.6  23-Apr-2008  plunky constify dirname(3) and basename(3)
 1.5  17-Oct-2002  thorpej branches: 1.5.30;
Change basename(3) and dirname(3) to return a pointer to static
storage, rather than modifying their input arguments. While not
reentrant, this is explcitly allowed by IEEE Std 1003.1-2001 (which
allows either behavior, stating that it is implementation-dependent).

The new semantics are considered less hostile/more useful by most programs
which use basename(3) and/or dirname(3) (several programs in the NetBSD
tree reimplement basename()/dirname() themselves to avoid modification
of the input argument).

This new implementation truncates results to PATH_MAX. The Std does
not address this in the static storage case. However since PATH_MAX
is the maximum pathname length in the Std, this should not be a problem
in practice. Nontheless, it is noted in the BUGS section.

See the basename(3)/dirname(3) regression tests in src/regress/lib/libc.

Inspired by discussion with Niels Provos, related to PR 18647.
 1.4  31-Jan-2002  tv branches: 1.4.2;
Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.3  21-Jan-2002  tv Add hooks for reachover builds from src/tools/compat.
 1.2  22-Jan-2000  mycroft branches: 1.2.6;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.1  02-Nov-1997  kleink Add basename() and dirname(), from XPG4.2.
 1.2.6.4  11-Nov-2002  nathanw Catch up to -current
 1.2.6.3  22-Mar-2002  nathanw Catch up to -current.
 1.2.6.2  08-Mar-2002  nathanw Catch up to -current.
 1.2.6.1  28-Jan-2002  nathanw Catch up to -current.
 1.4.2.1  07-Dec-2002  he Pull up revision 1.5 (requested by thorpej in ticket #918):
Change basename(3) and dirname(3) to return a pointer to
static storage instead of modifying their arguments. Fixes
PR#18647.
 1.5.30.1  18-May-2008  yamt sync with head.
 1.7.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.8.6.2  10-May-2008  christos undo the constification of the argument. Per opengroup.
 1.8.6.1  10-May-2008  christos file basename.c was added on branch christos-time_t on 2008-05-10 22:39:41 +0000
 1.9.22.1  10-Aug-2014  tls Rebase.
 1.9.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.

RSS XML Feed