svn commit: r264172 - stable/10/lib/libc/gen
Jilles Tjoelker
jilles at FreeBSD.org
Sat Apr 5 20:26:17 UTC 2014
Author: jilles
Date: Sat Apr 5 20:26:17 2014
New Revision: 264172
URL: http://svnweb.freebsd.org/changeset/base/264172
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: bin/187264
Modified:
stable/10/lib/libc/gen/fts.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/lib/libc/gen/fts.c
==============================================================================
--- stable/10/lib/libc/gen/fts.c Sat Apr 5 20:11:40 2014 (r264171)
+++ stable/10/lib/libc/gen/fts.c Sat Apr 5 20:26:17 2014 (r264172)
@@ -161,11 +161,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
mailing list