summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpho <pho@FreeBSD.org>1999-08-14 12:19:40 +0000
committerpho <pho@FreeBSD.org>1999-08-14 12:19:40 +0000
commiteffd222c57436670dfe5b8b06bd7a19a8cc61248 (patch)
treef93ad8599214ce7c2c73afc4c12dd01af92137d4 /lib
parent5f45261e990bb420f6394e615c3495668886dfe9 (diff)
downloadFreeBSD-src-effd222c57436670dfe5b8b06bd7a19a8cc61248.zip
FreeBSD-src-effd222c57436670dfe5b8b06bd7a19a8cc61248.tar.gz
Reviewed by: phk
When fts_open is used with option FTS_NOCHDIR the full path entry of type FTS_DP is returned with a trailing '/' if the final directory is empty. This fix coresponds to netbsd's __fts13.c v. 1.16
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/fts-compat.c2
-rw-r--r--lib/libc/gen/fts.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c
index da88ed1..16d05d9 100644
--- a/lib/libc/gen/fts-compat.c
+++ b/lib/libc/gen/fts-compat.c
@@ -748,7 +748,7 @@ mem1: saved_errno = errno;
* state.
*/
if (ISSET(FTS_NOCHDIR)) {
- if (len == sp->fts_pathlen)
+ if (cp - 1 > sp->fts_path)
--cp;
*cp = '\0';
}
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index da88ed1..16d05d9 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -748,7 +748,7 @@ mem1: saved_errno = errno;
* state.
*/
if (ISSET(FTS_NOCHDIR)) {
- if (len == sp->fts_pathlen)
+ if (cp - 1 > sp->fts_path)
--cp;
*cp = '\0';
}
OpenPOWER on IntegriCloud