summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/file.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-04-19 00:32:56 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-04-19 00:32:56 +0000
commitff65f61318ae7c2132520a61c271adc204c30950 (patch)
treedd4b01c6ba2257534459b3f7e01500cde71d3e8a /usr.bin/cvs/file.c
parent9b3f9eddfe96d2766176b20bcfc87853e4ddf336 (diff)
update cf_type to the correct type if we cannot stat(2) the
requested file or directory in cvs_file_lget(). should fix those "attempt to send Entry for non-regular file" errors. reported by brad@
Diffstat (limited to 'usr.bin/cvs/file.c')
-rw-r--r--usr.bin/cvs/file.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index ab497f340de..c92cca3abc8 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.65 2005/04/18 22:28:41 joris Exp $ */
+/* $OpenBSD: file.c,v 1.66 2005/04/19 00:32:55 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -919,8 +919,16 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent)
CVS_FILE_NAME(cfp));
cvs_file_free(cfp);
return (NULL);
- } else
+ } else {
+ if (ent->ce_type == CVS_ENT_FILE)
+ cfp->cf_type = DT_REG;
+ else if (ent->ce_type == CVS_ENT_DIR)
+ cfp->cf_type = DT_DIR;
+ else
+ cvs_log(LP_WARN, "unknown ce_type %d",
+ ent->ce_type);
cfp->cf_cvstat = CVS_FST_LOST;
+ }
}
if (ent != NULL) {