Date: Wed, 20 Aug 2014 20:12:05 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r270245 - stable/9/lib/libc/gen Message-ID: <201408202012.s7KKC5Rw098756@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408202012.s7KKC5Rw098756>