summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-08-16 07:57:02 +0000
committermillert <millert@openbsd.org>1999-08-16 07:57:02 +0000
commit35304ed979a07e4bcca1c4f87f448a1b2f5e90cc (patch)
treea5697034d46b641cc975352e41d5812bce5a8425
parentshorten dmesg output. (diff)
downloadwireguard-openbsd-35304ed979a07e4bcca1c4f87f448a1b2f5e90cc.tar.xz
wireguard-openbsd-35304ed979a07e4bcca1c4f87f448a1b2f5e90cc.zip
If the FTS_NOCHDIR flag is set and the final directory is empty,
the trailing '/' would not be chopped; pho@freebsd.org
-rw-r--r--lib/libc/gen/fts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 18264706cfc..ea2c34f2c1e 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.19 1999/05/17 02:32:31 millert Exp $ */
+/* $OpenBSD: fts.c,v 1.20 1999/08/16 07:57:02 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-static char rcsid[] = "$OpenBSD: fts.c,v 1.19 1999/05/17 02:32:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: fts.c,v 1.20 1999/08/16 07:57:02 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -776,7 +776,7 @@ mem1: saved_errno = errno;
* state.
*/
if (ISSET(FTS_NOCHDIR)) {
- if (len == sp->fts_pathlen)
+ if (len == sp->fts_pathlen || nitems == 0)
--cp;
*cp = '\0';
}