1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00
freebsd/bin/rmdir
Bruce Evans 8e9c31e830 Don't strip trailing slashes (for the initial rmdir). It breaks
following of the symlink for `rmdir symlink/' and is unnecessary
for ordinary directories (POSIX doesn't require rmdir(1) to do
anything for trailing slashes; it requires rmdir(2) to let them
"refer to a directory", and following the symlink for symlink/ is
what BSD does).  This also fixes bugs in the slash-stripping code
(for paths consisting entirely of slashes, the pointer into the
string was decremented to "before" the beginning of the string,
and the path was at best stripped to "".

The behaviour is unchanged except for the final directory for
`rmdir -p ...'.  There is no alternative to stripping intermediate
slashes since they must be specified.  The sloppy slash-stripping
code is adequate for intermediate directories, since the all-slashes
case fails early.
1997-12-19 20:20:22 +00:00
..
Makefile Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
rmdir.1 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
rmdir.c Don't strip trailing slashes (for the initial rmdir). It breaks 1997-12-19 20:20:22 +00:00