From effd222c57436670dfe5b8b06bd7a19a8cc61248 Mon Sep 17 00:00:00 2001 From: pho Date: Sat, 14 Aug 1999 12:19:40 +0000 Subject: 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 --- lib/libc/gen/fts-compat.c | 2 +- lib/libc/gen/fts.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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'; } -- cgit v1.1