Documentation: don't reference non-existent 'git-cvsapplycommit'
[gitweb.git] / builtin-apply.c
index a5d612655f82e071c8e7d961660a6f1d562f6f40..db5272245569f4080a07cdb3a2aacd2c0cbda38c 100644 (file)
@@ -2416,8 +2416,7 @@ static void create_one_file(char *path, unsigned mode, const char *buf, unsigned
                 * used to be.
                 */
                struct stat st;
-               errno = 0;
-               if (!lstat(path, &st) && S_ISDIR(st.st_mode) && !rmdir(path))
+               if (!lstat(path, &st) && (!S_ISDIR(st.st_mode) || !rmdir(path)))
                        errno = EEXIST;
        }