Date: Wed, 19 Feb 1997 09:49:23 +0200 (IST) From: Eli Zaretskii To: "John M. Aldrich" cc: DJGPP Workers Mailing List , "Vyacheslav O. Myskin" , djgpp AT delorie DOT com Subject: Re: Starnge rm behavour In-Reply-To: <330AAE6B.537A@cs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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?