From: Alex Riesen Date: Tue, 08 May 2007 09:08:35 GMT Subject: Re: [PATCH] remove unnecessary loop Message-ID: <81b0412b0705080208x3713cbc1y3c870383b586c877@mail.gmail.com> In-Reply-To: <4640015F.1080407@gmail.com> On 5/8/07, Liu Yubao wrote: > +#ifdef __CYGWIN__ > + /* > + * On cygwin, lstat("hello", &st) returns 0 when > + * "hello.exe" exists, so test with open() again. > + */ > + if (lstat(match, &st) && -1 != (fd = open(match, O_RDONLY))) { This does not "test again" if lstat returns 0. If lstat returns 0 (file stat info obtained) the open is not even called. Besides, cygwin lies not only about .exe but also about .lnk files. P.S. Somehow I have the feeling that even if it is a stupidity in cygwin they will not fix it (nor will they admit it is a bug).