diff options
-rw-r--r-- | usr.bin/cvs/update.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index b4cf0f98c84..684e478cf3c 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.157 2009/02/21 14:50:53 joris Exp $ */ +/* $OpenBSD: update.c,v 1.158 2009/03/21 11:16:28 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -246,6 +246,12 @@ cvs_update_leavedir(struct cvs_file *cf) if (cvs_server_active == 1 && !strcmp(cf->file_name, ".")) return; + entlist = cvs_ent_open(cf->file_path); + if (!TAILQ_EMPTY(&(entlist->cef_ent))) { + isempty = 0; + goto prune_it; + } + if (fstat(cf->fd, &st) == -1) fatal("cvs_update_leavedir: %s", strerror(errno)); @@ -276,13 +282,8 @@ cvs_update_leavedir(struct cvs_file *cf) continue; } - if (!strcmp(dp->d_name, CVS_PATH_CVSDIR)) { - entlist = cvs_ent_open(cf->file_path); - if (!TAILQ_EMPTY(&(entlist->cef_ent))) - isempty = 0; - } else { + if (strcmp(dp->d_name, CVS_PATH_CVSDIR)) isempty = 0; - } if (isempty == 0) break; @@ -296,6 +297,7 @@ cvs_update_leavedir(struct cvs_file *cf) xfree(buf); +prune_it: if ((isempty == 1 && prune_dirs == 1) || (cvs_server_active == 1 && cvs_cmdop == CVS_OP_CHECKOUT)) { /* XXX */ |