delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/24/03:47:12

Date: Sun, 24 Jan 1999 10:43:02 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Minor bug in stat.c
Message-ID: <Pine.SUN.3.91.990124104144.4501G-100000@is>
MIME-Version: 1.0
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;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019