Date: Fri, 19 Dec 1997 12:20:25 -0800 (PST) From: Bruce Evans <bde@FreeBSD.ORG> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-bin@FreeBSD.ORG Subject: cvs commit: src/bin/rmdir rmdir.c Message-ID: <199712192020.MAA03135@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
bde 1997/12/19 12:20:24 PST Modified files: bin/rmdir rmdir.c Log: 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. Revision Changes Path 1.7 +1 -9 src/bin/rmdir/rmdir.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712192020.MAA03135>