=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- src/usr.bin/cvs/file.c 2005/01/12 20:10:09 1.51 +++ src/usr.bin/cvs/file.c 2005/01/24 16:41:28 1.52 @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.51 2005/01/12 20:10:09 jfb Exp $ */ +/* $OpenBSD: file.c,v 1.52 2005/01/24 16:41:28 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -910,9 +910,6 @@ else cfp->cf_cvstat = CVS_FST_MODIFIED; } - - cvs_ent_remove(CVS_DIR_ENTRIES(parent), - CVS_FILE_NAME(cfp)); } } else { if (ent == NULL) { @@ -923,6 +920,9 @@ } else cfp->cf_cvstat = CVS_FST_LOST; } + + if (ent != NULL) + cvs_ent_remove(CVS_DIR_ENTRIES(parent), CVS_FILE_NAME(cfp)); if ((cfp->cf_type == DT_DIR) && (cvs_file_getdir(cfp, flags) < 0)) { cvs_file_free(cfp);