X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff-no-index.c;h=4ebc1dbd87d9b90ad2aaa5c7d4601761e2d1d724;hb=ee0400df4eb13ea9b1ee3f03a50e479048f1780f;hp=a3e47a76e401a1b98891b15a406b5806a294af3d;hpb=58066bec5a2cd8f5b6bb4884c8162364374ba0c1;p=git.git diff --git a/diff-no-index.c b/diff-no-index.c index a3e47a76e..4ebc1dbd8 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; @@ -229,7 +233,7 @@ void diff_no_index(struct rev_info *revs, if (prefix) { int len = strlen(prefix); - revs->diffopt.paths = xcalloc(2, sizeof(char*)); + revs->diffopt.paths = xcalloc(2, sizeof(char *)); for (i = 0; i < 2; i++) { const char *p = argv[argc - 2 + i]; /*