Mail Archives: djgpp-workers/1999/01/27/11:08:28
On Tue, 26 Jan 1999, Pierre Muller wrote:
> Why doesn't redir.exe (DJGPP version from src/utils directory)
> expands wildcards for its child program ?
What version of DJGPP are you using? Is that v2.01? If not, upgrade to
v2.02, where several subtle bugs in `redir' were corrected.
> redir -e log grep unfreed log*
> allways ends up in
>
> grep : log* : No such file or director...
>
> What is the reason for disabling wilcard expansion in redir ?
`redir' itself shouldn't expand wildcards, it should leave that to the
program it runs. `redir' doesn't know (and shouldn't know) what will the
subsidiary program do with the wildcards. For example, if the subsidiary
program itself disables wildcard expansion, expanding them in `redir'
would be the wrong thing.
In other words, `redir' should invoke the subsidiary program so that the
argv[] array is *exactly* like it would be if the subsidiary program were
invoked directly from the command line.
The problem with `redir' before v2.02 was that it invoked the subsidiary
programs in a way that prevented them (the subsidiary programs) from
expanding the wildcards themselves. This is a tricky subject, and very
complicated to explain (which is one reason why it wasn't fixed until
recently); for details, download djlsr202.zip, look into redir.c, and
*then* ask more specific questions if the comments there don't explain
this mess well enough.
- Raw text -