Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2009 17:22:00 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r201263 - stable/8/lib/libc/gen
Message-ID:  <200912301722.nBUHM03r065310@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Wed Dec 30 17:22:00 2009
New Revision: 201263
URL: http://svn.freebsd.org/changeset/base/201263

Log:
  MFC r199844:
  
  Reset path name back to original correctly in fts_build() when
  FTS_NOCHDIR option is used. fts_build() could strip a trailing slash
  from path name in post-order visit if a path pointing to an empty
  directory was given for fts_open().
  
  PR:		bin/133907, kern/134513
  Approved by:	trasz (mentor)

Modified:
  stable/8/lib/libc/gen/fts.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/gen/fts.c
==============================================================================
--- stable/8/lib/libc/gen/fts.c	Wed Dec 30 17:16:49 2009	(r201262)
+++ stable/8/lib/libc/gen/fts.c	Wed Dec 30 17:22:00 2009	(r201263)
@@ -836,11 +836,8 @@ mem1:				saved_errno = errno;
 	 * If not changing directories, reset the path back to original
 	 * state.
 	 */
-	if (ISSET(FTS_NOCHDIR)) {
-		if (len == sp->fts_pathlen || nitems == 0)
-			--cp;
-		*cp = '\0';
-	}
+	if (ISSET(FTS_NOCHDIR))
+		sp->fts_path[cur->fts_pathlen] = '\0';
 
 	/*
 	 * If descended after called from fts_children or after called from



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912301722.nBUHM03r065310>