summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fts.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-10-11 04:04:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-10-11 04:04:41 +0000
commit16b5445f4366df3e6bbdf1ba23743261c5a29eca (patch)
tree8b6df14645192279e214150637498b4c95e49044 /lib/libc/gen/fts.c
parent235dc432484a48747b39aa08f905a72e3437503a (diff)
Replace my trailing slash removal with the one from FreeBSD.
Diffstat (limited to 'lib/libc/gen/fts.c')
-rw-r--r--lib/libc/gen/fts.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 63b395148fc..161853fc24c 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.13 1997/10/06 23:32:49 millert Exp $ */
+/* $OpenBSD: fts.c,v 1.14 1997/10/11 04:04:40 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.13 1997/10/06 23:32:49 millert Exp $";
+static char rcsid[] = "$OpenBSD: fts.c,v 1.14 1997/10/11 04:04:40 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -87,7 +87,6 @@ fts_open(argv, options, compar)
register FTSENT *p, *root;
register int nitems;
FTSENT *parent, *tmp;
- char *a;
int len;
/* Options check. */
@@ -127,13 +126,6 @@ fts_open(argv, options, compar)
goto mem3;
}
- /* Strip trailing '/' from paths */
- a = *argv + len - 1;
- while (a > *argv && *a == '/') {
- a--;
- len--;
- }
-
p = fts_alloc(sp, *argv, len);
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;
@@ -777,7 +769,7 @@ mem1: saved_errno = errno;
* state.
*/
if (ISSET(FTS_NOCHDIR)) {
- if (cp - 1 > sp->fts_path)
+ if (len == sp->fts_pathlen)
--cp;
*cp = '\0';
}