Commit Graph

11 Commits

Author SHA1 Message Date
tnozaki
3f8ca7c44a 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).
2009-11-24 13:34:20 +00:00
christos
8e11cb8cb8 undo the constification of the argument. Per opengroup. 2008-05-10 22:39:40 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
plunky
043900c0cb constify dirname(3) and basename(3) 2008-04-23 07:53:26 +00:00
tron
12b88f0269 Fix lint error. 2002-10-17 11:36:39 +00:00
thorpej
c10a556f9b 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.
2002-10-17 02:06:04 +00:00
tv
9fbd88883c 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.
2002-01-31 22:43:33 +00:00
tv
c08a2cb7c2 Add hooks for reachover builds from src/tools/compat. 2002-01-21 21:33:42 +00:00
simonb
e8bf848218 Unwrap a line that wasn't >80 characters long before it was wrapped. 2001-09-15 15:43:40 +00:00
mycroft
605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
kleink
8bfc0cef1e Add basename() and dirname(), from XPG4.2. 1997-11-02 16:48:25 +00:00