diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-03-05 17:19:51 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-03-05 17:19:51 +0000 |
commit | de6908704e90d9203ed10495e1bb51a877bab833 (patch) | |
tree | 8d687c5b57e7a4863bed61dfafd141ecdf91af5c /usr.bin | |
parent | d4078f7b52ee4eadadf5450cf77d907ed57473db (diff) |
fix file loading when recursion is disabled. this should fix the
weird behaviour encountered when using the -l option to most
commands
ok joris@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/file.c | 12 |
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); |