svn commit: r270245 - stable/9/lib/libc/gen
Jilles Tjoelker
jilles at FreeBSD.org
Wed Aug 20 20:12:05 UTC 2014
Author: jilles
Date: Wed Aug 20 20:12:05 2014
New Revision: 270245
URL: http://svnweb.freebsd.org/changeset/base/270245
Log:
MFC r262872: fts: Don't abort if an empty pathname is given.
Make fts_open(3) treat an empty pathname like any other pathname that cannot
be lstatted because of [ENOENT].
It is rather confusing if rm -rf file1 "" file2 does not remove file1 and
file2.
PR: 187264
Modified:
stable/9/lib/libc/gen/fts.c
Directory Properties:
stable/9/lib/libc/ (props changed)
Modified: stable/9/lib/libc/gen/fts.c
==============================================================================
--- stable/9/lib/libc/gen/fts.c Wed Aug 20 19:39:07 2014 (r270244)
+++ stable/9/lib/libc/gen/fts.c Wed Aug 20 20:12:05 2014 (r270245)
@@ -160,11 +160,7 @@ fts_open(argv, options, compar)
/* Allocate/initialize root(s). */
for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
- /* Don't allow zero-length paths. */
- if ((len = strlen(*argv)) == 0) {
- errno = ENOENT;
- goto mem3;
- }
+ len = strlen(*argv);
p = fts_alloc(sp, *argv, len);
p->fts_level = FTS_ROOTLEVEL;
More information about the svn-src-stable-9
mailing list