Menu

#2328 Literal backslash in single quotes

WSL
closed
None
Bug
fixed
IINR_-_Include_In_Next_Release
True
2017-01-25
2017-01-05
Jason Hood
No

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 '\\\'
\\\
1 Attachments

Discussion

  • Keith Marshall

    Keith Marshall - 2017-01-08

    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.

     
  • Keith Marshall

    Keith Marshall - 2017-01-08
    • status: unread --> open
    • assigned_to: Keith Marshall
    • Category: Unknown --> IINR_-_Include_In_Next_Release
     
  • Keith Marshall

    Keith Marshall - 2017-01-25
    • status: open --> closed
    • Resolution: none --> fixed
     
  • Keith Marshall

    Keith Marshall - 2017-01-25

    I committed [490e36].

     

    Related

    Commit: [490e36]