From 9ee1988ec45195add8c149f5ab93f7720bd3ed90 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Sat, 27 Jan 2007 20:23:27 +0000 Subject: when we specify the 'f' flag do not bother removing files that dont exist on disk anyway, and when removing a file that has been added but not commited the correct file_status is FILE_REMOVE_ENTRY and not FILE_ADDED. ok otto@ --- usr.bin/cvs/remove.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index 6c30a5df4b5..1699b896915 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.60 2007/01/11 02:35:55 joris Exp $ */ +/* $OpenBSD: remove.c,v 1.61 2007/01/27 20:23:26 joris Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria * @@ -121,7 +121,7 @@ void cvs_remove_force(struct cvs_file *cf) { if (cf->file_type != CVS_DIR) { - if (force_remove == 1 && cvs_noexec == 0) { + if (cf->fd != -1 && force_remove == 1 && cvs_noexec == 0) { if (unlink(cf->file_path) == -1) fatal("cvs_remove_force: %s", strerror(errno)); (void)close(cf->fd); @@ -161,7 +161,7 @@ cvs_remove_local(struct cvs_file *cf) existing++; } else { switch (cf->file_status) { - case FILE_ADDED: + case FILE_REMOVE_ENTRY: entlist = cvs_ent_open(cf->file_wd); cvs_ent_remove(entlist, cf->file_name); cvs_ent_close(entlist, ENT_SYNC); -- cgit v1.2.3