diff options
author | pho <pho@FreeBSD.org> | 1999-08-14 12:19:40 +0000 |
---|---|---|
committer | pho <pho@FreeBSD.org> | 1999-08-14 12:19:40 +0000 |
commit | effd222c57436670dfe5b8b06bd7a19a8cc61248 (patch) | |
tree | f93ad8599214ce7c2c73afc4c12dd01af92137d4 /lib/libc | |
parent | 5f45261e990bb420f6394e615c3495668886dfe9 (diff) | |
download | FreeBSD-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/libc')
-rw-r--r-- | lib/libc/gen/fts-compat.c | 2 | ||||
-rw-r--r-- | lib/libc/gen/fts.c | 2 |
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'; } |