Code

test-lib.sh: Test for presence of git-init in the right path.
[git.git] / diff-no-index.c
index 2d541d9aba11ee69525a6a1ef5da6f8a61e9e65e..598687b50ac7b88ca0860faf1670d03047bb3603 100644 (file)
@@ -38,9 +38,13 @@ static int get_mode(const char *path, int *mode)
 
        if (!path || !strcmp(path, "/dev/null"))
                *mode = 0;
+#ifdef _WIN32
+       else if (!strcasecmp(path, "nul"))
+               *mode = 0;
+#endif
        else if (!strcmp(path, "-"))
                *mode = create_ce_mode(0666);
-       else if (stat(path, &st))
+       else if (lstat(path, &st))
                return error("Could not access '%s'", path);
        else
                *mode = st.st_mode;