summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/file.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index ad0bbd30858..cf0b428d56a 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.55 2005/03/05 03:00:27 jfb Exp $ */
+/* $OpenBSD: file.c,v 1.56 2005/03/05 17:19:50 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -586,8 +586,7 @@ cvs_file_getdir(CVSFILE *cf, int flags)
}
}
- if (!(flags & CF_RECURSE) ||
- ((flags & CF_KNOWN) && (cf->cf_cvstat == CVS_FST_UNKNOWN)))
+ if ((flags & CF_KNOWN) && (cf->cf_cvstat == CVS_FST_UNKNOWN))
return (0);
fd = open(fpath, O_RDONLY);
@@ -628,6 +627,13 @@ cvs_file_getdir(CVSFILE *cf, int flags)
if ((flags & CF_NOSYMS) && (ent->d_type == DT_LNK))
continue;
+ if (!(flags & CF_RECURSE) && (ent->d_type == DT_DIR)) {
+ if (cdp->cd_ent != NULL)
+ (void)cvs_ent_remove(cdp->cd_ent,
+ ent->d_name);
+ continue;
+ }
+
snprintf(pbuf, sizeof(pbuf), "%s/%s", fpath,
ent->d_name);
cfp = cvs_file_lget(pbuf, flags, cf);