summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2009-04-07 21:27:46 +0000
committerJoris Vink <joris@cvs.openbsd.org>2009-04-07 21:27:46 +0000
commit2ca4fb0409446aa3e558950b94df600ddd614f33 (patch)
treebc878e8c18b5d5b09ea62ad1874eba01556a64d5 /usr.bin
parent46c923d7e1e7be08bd5c46dad9463af9b60e6112 (diff)
do not try to send a added file that is no longer on disk
towards the server. problem spotted and diff tested by sthen@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/remote.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/cvs/remote.c b/usr.bin/cvs/remote.c
index 1bd15dd964c..09a828cac57 100644
--- a/usr.bin/cvs/remote.c
+++ b/usr.bin/cvs/remote.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: remote.c,v 1.27 2009/04/02 20:57:47 joris Exp $ */
+/* $OpenBSD: remote.c,v 1.28 2009/04/07 21:27:45 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -249,10 +249,15 @@ cvs_remote_classify_file(struct cvs_file *cf)
cf->file_ent = cvs_ent_get(entlist, cf->file_name);
if (cf->file_ent != NULL && cf->file_ent->ce_status != CVS_ENT_REG) {
- if (cf->file_ent->ce_status == CVS_ENT_ADDED)
- cf->file_status = FILE_ADDED;
- else
+ if (cf->file_ent->ce_status == CVS_ENT_ADDED) {
+ if (cf->fd != -1)
+ cf->file_status = FILE_ADDED;
+ else
+ cf->file_status = FILE_UNKNOWN;
+ } else {
cf->file_status = FILE_REMOVED;
+ }
+
return;
}