Date: Sun, 24 Jan 1999 10:43:02 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Minor bug in stat.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com ``stat ("")'' succeeds and returns the info for ".". Here's the fix: *** src/libc/posix/sys/stat/stat.c~0 Tue Aug 25 09:47:26 1998 --- src/libc/posix/sys/stat/stat.c Sat Jan 23 16:07:12 1999 *************** stat(const char *path, struct stat *stat *** 862,869 **** return -1; } ! /* Fail if PATH includes wildcard characters supported by FindFirst. */ ! if (memchr(path, '*', pathlen) || memchr(path, '?', pathlen)) { errno = ENOENT; /* since no such filename is possible */ return -1; --- 862,871 ---- return -1; } ! /* Fail if PATH includes wildcard characters supported by FindFirst, ! or if it is empty. */ ! if (memchr(path, '*', pathlen) || memchr(path, '?', pathlen) ! || path[0] == '\0') { errno = ENOENT; /* since no such filename is possible */ return -1;