forked from msysgit/git
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The quoting rules of `cmd.exe` are really, really quirky. In particular, if there are more than two quotes, the entire set of rules changes. That is the reason why CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i works, but CMD /C "C:\Program Files\Git\usr\bin\bash.exe" -l -i "test.sh" fails with this error message: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. The recommended fix is to pass the /S option to `cmd.exe` and surround the entire command-line by an extra set of quotes. And here lies the rub: for that to work, we have to append an extra quote. At the end of the command-line. *After* the last argument was appended, if any. This commit supports that use case by introducing the option "APPEND_QUOTE". The intended usage is to use the following string resource: SHOW_CONSOLE=1 APPEND_QUOTE=1 @@comspec@@ /S /C \"\"@@EXEPATH@@\\usr\\bin\\bash.exe\" --login -i (Note that there are only three quotes on that command-line, the fourth to be appended due to the `APPEND_QUOTE` setting.) This is (1/3) to fix git-for-windows#396 Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information
Showing
1 changed file
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters