Don't look at file_type until after cvs_remote_classify_file() was called.
authorjoris <joris@openbsd.org>
Thu, 1 Jun 2017 08:17:27 +0000 (08:17 +0000)
committerjoris <joris@openbsd.org>
Thu, 1 Jun 2017 08:17:27 +0000 (08:17 +0000)
The file status may be unknown until after that call.

usr.bin/cvs/client.c

index 5254e00..664ba30 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: client.c,v 1.125 2015/11/05 09:48:21 nicm Exp $       */
+/*     $OpenBSD: client.c,v 1.126 2017/06/01 08:17:27 joris Exp $      */
 /*
  * Copyright (c) 2006 Joris Vink <joris@openbsd.org>
  *
@@ -454,13 +454,10 @@ cvs_client_sendfile(struct cvs_file *cf)
        struct tm datetm;
        char rev[CVS_REV_BUFSZ], timebuf[CVS_TIME_BUFSZ], sticky[CVS_REV_BUFSZ];
 
-       if (cf->file_type != CVS_FILE)
-               return;
-
        cvs_client_senddir(cf->file_wd);
        cvs_remote_classify_file(cf);
 
-       if (cf->file_type == CVS_DIR)
+       if (cf->file_type != CVS_FILE)
                return;
 
        if (cf->file_ent != NULL && cvs_cmdop != CVS_OP_IMPORT) {