From: SourceForge.net <no...@so...> - 2007-10-08 12:43:40
|
Bugs item #1808082, was opened at 2007-10-05 15:48 Message generated for change (Comment added) made by helihickle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1808082&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: msys Group: Known Feature >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: HeliHickle (helihickle) Assigned to: Cesar Strauss (cstrauss) Summary: bash/sh quoting incorrect Initial Comment: Using current and snapshot versions of bash.exe / sh.exe and current and snapshot versions of msys-1.0.dll, quoting is not handled correctly. Single quotes mean literal text, while double quotes allow some expansion, but not wildcards. It's strange that the built-in echo does work correctly. Below, I use programs that print the command line arguments using argv. To be certain, I use both a MinGW and a Delphi version. $ echo '/\*' /\* $ mingwargs '/\*' arg 0: c:\Users\...\C\HCL\mingwargs.exe arg 1: //* $ delphiargs '/\*' arg 0: c:\Users\...\C\HCL\delphiargs.exe arg 1: //* $ echo '/' / $ mingwargs '/' arg 0: c:\Users\...\C\HCL\mingwargs.exe arg 1: C:/Users/.../bin/Applications/MinGW/MSYS $ delphiargs '/' arg 0: c:\Users\...\C\HCL\delphiargs.exe arg 1: C:/Users/.../bin/Applications/MinGW/MSYS This is also the case with double quotes. ---------------------------------------------------------------------- >Comment By: HeliHickle (helihickle) Date: 2007-10-08 14:43 Message: Logged In: YES user_id=1863959 Originator: YES You don't get my point. It is documented that in bash nothing is expanded between single quotes (and a little bit between double quoates). As I showed you, this is not the case with the bash of MSYS. I know that '/' expands to the Windows path, but this should never happen between any quotes in bash! Note also that in the above example '\' is changed to '/', which makes it even stranger, because this is not documented at all! As I showed you, the built-in echo shows its argument correctly. This gives me the impression that the bug is not in bash itself, but in some adaption of exec or createProcess, or something that changes the arguments of such a call. Trying to be smart at this level is rather dangerous, because this makes bash quoting useless at this point. And because bash is the base of MSYS, I think this is a major bug. >From my point of view, the 'smart' changing of arguments has to be done from bash only for arguments not contained within quotes and just before the filename expansion or globbing. I am having these problems while writing a regular expression for grep. Do you know a way how to get the argument '/\*' to grep? ---------------------------------------------------------------------- Comment By: HeliHickle (helihickle) Date: 2007-10-08 14:41 Message: Logged In: YES user_id=1863959 Originator: YES You don't get my point. It is documented that in bash nothing is expanded between single quotes (and a little bit between double quoates). As I showed you, this is not the case with the bash of MSYS. I know that '/' expands to the Windows path, but this should never happen between any quotes in bash! Note also that in the above example '\' is changed to '/', which makes it even stranger, because this is not documented at all! As I showed you, the built-in echo shows its argument correctly. This gives me the impression that the bug is not in bash itself, but in some adaption of exec or createProcess, or something that changes the arguments of such a call. Trying to be smart at this level is rather dangerous, because this makes bash quoting useless at this point. And because bash is the base of MSYS, I think this is a major bug. >From my point of view, the 'smart' changing of arguments has to be done from bash only for arguments not contained within quotes and just before the filename expansion or globbing. I am having these problems while writing a regular expression for grep. Do you know a way how to get the argument '/\*' to grep? ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-10-05 22:55 Message: Logged In: YES user_id=15438 Originator: NO '/' is a virtual pointer to a windows path. It points to C:/Users/.../bin/Applications/MinGW/MSYS for you. This works as expected. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1808082&group_id=2435 |