Message-ID: <330AAE6B.537A@cs.com> Date: Tue, 18 Feb 1997 23:40:27 -0800 From: "John M. Aldrich" Reply-To: fighteer AT cs DOT com Organization: Two pounds of chaos and a pinch of salt MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp CC: DJGPP Workers Mailing List Subject: Re: Starnge rm behavour References: <189BCEB38C6 AT csd DOT inp DOT nsk DOT su> <330A4A9A DOT 2BE1 AT cs DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit (I'm CC'ing this to djgpp-workers as a bug report.) > Vyacheslav O. Myskin wrote: > > > > redir -e err. rm * > > > > it says: > > > > c:/djgpp/bin/rm: *: No such file or directory (ENOENT) > > > > What's wrong with it? I use DJGPP 2.01, make 3.75 and rm from fil313b.zip. Okay, I think I've figured out what the problem is, and oddly enough it's one of those things that was originally intended as a "feature". :) If you take a look at the new v2.01 docs you'll see something called the Knowledge Base. Among other things, this contains a description of what is new from v2.00 to v2.01. Note the following item: [...] Command line arguments are not wildcard-expanded if they were passed through `spawn*()' or `exec*()' [...] 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'. I _think_ the problem can be solved by making redir call system() instead of spawnvp(). This would however require it to essentially rebuild the command line from its components. It's not hard to do, but would make redir take up slightly more memory at runtime. Is there anything that might break as a result of such a modification? If not, then I see no reason not to do it... -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | God's final message to His Creation: | http://www.cs.com/fighteer | | "We apologize for the inconvenience."| Fight against proprietary | | - Douglas Adams | software - support the FSF!| ---------------------------------------------------------------------