Originally reported by Eli Zaretskii; see http://thread.gmane.org/gmane.comp.gnu.mingw.user/38302
When a globbing character appears within a quoted shell command argument, then glob expansion should not occur. This behaviour may be correctly observed when passing such arguments to shell built-in commands, or MSYS-aware applications, (i.e. those linked with msys-1.0.dll). However, when passing such arguments to MinGW applications, the protective quotes are not preserved, and the globbing characters are inappropriately expanded by the MSVCRT startup code.
There are two issues identified in the original mail thread:
1) When passing arguments to MinGW applications, quoting is correctly applied to ensure that embedded white-space, escapes and double quotes are preserved. The same courtesy needs to be accorded to globbing characters which have not been expanded by the shell itself; the current implementation neglects this requirement. The remedy for this defect is entirely within MSYS remit.
2) Recent versions of MSVCRT itself, apparently by Microsoft design, may not honour quoting as protection from glob expansion. It further appears that Microsoft have refused to correct this regression; thus it may be necessary to develop an augmented MinGW startup capability, eschewing the MSVCRT startup code in favour of our own -- perhaps as a user selectable option -- which will DTRT.
Log in to post a comment.