X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=diff-no-index.c;h=598687b50ac7b88ca0860faf1670d03047bb3603;hb=7ee3760e2c8f181f22d4b80afc03309e4f764385;hp=2d541d9aba11ee69525a6a1ef5da6f8a61e9e65e;hpb=d9b04430d238be1fe75ef97e3455c65ca72a7fa0;p=git.git diff --git a/diff-no-index.c b/diff-no-index.c index 2d541d9ab..598687b50 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -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;