Opened 6 years ago

Last modified 4 years ago

#268 new defect

Double quotes break wildcard argument processing

Reported by: dmik Owned by: bird
Priority: normal Milestone: libc-0.7
Component: libc Version: 0.6.4
Severity: normal Keywords:


_wildcard() ignores arguments with wildcard symbols that also contain quote characters (regardless of the position). For instance, if your program gets called like this:

    myporog.exe "my file"*

you will get my file* as the argument value after calling _wildcard() instead of a list of files matching this mask. This is because the parse_args() code in sys/init.c will mark such an argument with _ARG_DQUOTE and arguments with this flag get unconditionally ignored by _wildcard().

This behavior is not correct. As seen from the example it simply doesn't allow to use wildcards with spaces. It also doesn't match the behavior of Unix LIBC where such wildcards are pretty valid (wildcard expansion is only suppressed if the wildcard char itself is within quotes, like "my file*"). As a result of such incompatibility we have problems like the one described in

Change History (2)

comment:1 Changed 6 years ago by dmik

Or, may be #259 isn't actually related (no quotes there) but still, with the current libc, ls and cp will also not work if the wildcard argument contains quotes.

comment:2 Changed 4 years ago by bird

  • Milestone set to libc-0.7

This is ancient EMX behavior and isn't a unix shell script compatibility issue, just an issue for cmd.exe/4os2.exe users. So, I'm scheduling this for 0.7.

Note: See TracTickets for help on using tickets.