From: Johannes Sixt Date: Sat, 07 Mar 2009 19:56:58 GMT Subject: Re: [PATCH] MinGW: fix diff --no-index /dev/null ... Message-ID: <200903072056.58465.j6t@kdbg.org> In-Reply-To: On Samstag, 7. März 2009, Johannes Schindelin wrote: > --- a/diff-no-index.c > +++ b/diff-no-index.c > @@ -38,6 +38,10 @@ 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 (lstat(path, &st)) IMO this #ifdef is a reasonable compromise. Trying to move this into git-compat-util.h or mingw.h somehow would only obfuscate the code. Tested-by: Johannes Sixt -- Hannes