All characters in single quotes should be treated literally (according to the
Bash manual), so this is a patch to remove backslash handling in single quotes.
T:\>cat test.c #include <stdio.h> int _CRT_glob = __CRT_GLOB_USE_MINGW__ | __CRT_GLOB_USE_SINGLE_QUOTE__; int main(int argc, char** argv) { puts(argv[1]); } T:\>gcc test.c -s -o old.exe T:\>gcc test.c -s -o new.exe -Lmingwrt-3.22.4-1 T:\>old '\\\' \' T:\>new '\\\' \\\
Thanks for the patch. It would have carried more weight, had you cited the POSIX.1-2008 reference, rather than the bash manual -- bash's behaviour can be questionable, at times. Nonetheless, this patch does seem to DTRT, (although curiously, the
posh
shell -- supposedly a reference implementation of the POSIX shell -- on my LinuxMint Debian box does not), so I've imported it, with minor modifications and correction of inappropriate CRLF line endings, into my local patch queue, for inclusion in the next mingwrt release.I committed [490e36].
Related
Commit: [490e36]