Mail Archives: djgpp-workers/1997/02/18/23:43:33
(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!|
---------------------------------------------------------------------
- Raw text -