delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/17/02:19:21

Date: Thu, 17 Oct 1996 08:15:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: Grep'ing for % hangs my system
In-Reply-To: <199610162308.TAA29949@delorie.com>
Message-Id: <Pine.SUN.3.91.961017080830.24213C-100000@is>
Mime-Version: 1.0

On Wed, 16 Oct 1996, DJ Delorie wrote:

> We'll be patching it forever at that rate.  Are they really needed, or
> can they wait for the next release?

I would recommend to include `_rename' patch, or else people will have
some nasty file overwrites on Windows 95, especially when using Emacs or
GNU Fileutils.  The patch is tested fairly well, I think (that's why I
didn't mail it right away). 

The current version of `stat' causes some stupid failures in `rm'.  If you
say e.g.  "rm *~" in directory with no matching files, you get an error
message saying "*~ is a directory" (huh?).  Anyway, the patch is very
small (below); but if you feel it's too late, then don't include it.

*** src/libc/posix/sys/stat/stat.c~0	Fri Sep 27 22:05:26 1996
--- src/libc/posix/sys/stat/stat.c	Wed Oct 16 19:40:24 1996
*************** stat(const char *path, struct stat *stat
*** 791,796 ****
--- 791,803 ----
        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;
+     }
+ 
    /* Make the path explicit.  This makes the rest of our job much
       easier by getting rid of some constructs which, if present,
       confuse `_truename' and/or `findfirst'.  In particular, it

- Raw text -


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