www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/19/02:59:01

Date: Wed, 19 Feb 1997 09:49:23 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "John M. Aldrich" <fighteer AT cs DOT com>
cc: DJGPP Workers Mailing List <djgpp-workers AT delorie DOT com>,
"Vyacheslav O. Myskin" <V DOT O DOT Myskin AT inp DOT nsk DOT su>, djgpp AT delorie DOT com
Subject: Re: Starnge rm behavour
In-Reply-To: <330AAE6B.537A@cs.com>
Message-ID: <Pine.SUN.3.91.970219093838.22519A-100000@is>
MIME-Version: 1.0

On Tue, 18 Feb 1997, John M. Aldrich wrote:

> The problem seems to be occurring because 'redir' doesn't perform
> wildcard expansion on the command line it gets passed, yet it uses
> spawnvp() to invoke the indicated program with the remaining arguments. 
> Obviously, this breaks any program which gets passed a wildcard,
> including 'rm'.

This analysis is correct.  `redir' doesn't glob the command line so you
could use the same command with and without it (otherwise you would have
to quote the wildcards when running programs from `redir').  When in v2.01
arguments passed by `spawnXX' stopped from being expanded on the child
side, this feature introduced a bug in some (admittedly rare) cases. 

> I _think_ the problem can be solved by making redir call system()
> instead of spawnvp().

This is indeed the solution.  Would you please submit the patches?  
Thanks.

> It's not hard to do, but
> would make redir take up slightly more memory at runtime.

The extra memory is in extended memory, so it maight only cause your 
system to page a bit earlier.  I don't think this is a severe problem.

> Is there anything that might break as a result of such a modification? 

One effect of calling `system' is that if your $SHELL points to a 
Unix-like shell, `system' will call it to do the job.  I don't think this 
should break anything, but if it does, there's a bit you can set to 
prevent `system' from doing this (all the flag bits are documented in
libc.inf).  Would people who use `bash' as their interactive shell please 
tell whether calling the shell from `redir' should make any trouble?

- Raw text -


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