Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command-line arguments to Windows exe - double quotes not passed as expected #2411

Closed
lukebakken opened this issue Aug 11, 2017 · 2 comments
Closed

Comments

@lukebakken
Copy link

lukebakken commented Aug 11, 2017

  • Your Windows build number:

Microsoft Windows [Version 10.0.15063]

  • What you're doing and what's happening:

I first discovered this while trying out the RabbitMQ build system using WSL and the Win32 build of Erlang 20, but simplified it to this case that uses EchoArgs.exe (installed via choco install echoargs):

lbakken@DSCH-WIN:~$ /mnt/c/ProgramData/chocolatey/lib/echoargs/tools/EchoArgs.exe '"foobar"'
Unable to translate current working directory. Using C:\Users\lbakken
Arg 0 is <foobar>

Command line:
C:\ProgramData\chocolatey\lib\echoargs\tools\EchoArgs.exe "foobar"

lbakken@DSCH-WIN:~$ /mnt/c/ProgramData/chocolatey/lib/echoargs/tools/EchoArgs.exe '\"foobar\"'
Unable to translate current working directory. Using C:\Users\lbakken
Arg 0 is <"foobar">

Command line:
C:\ProgramData\chocolatey\lib\echoargs\tools\EchoArgs.exe \"foobar\"
  • What's wrong / what should be happening instead:

I would expect that the argument '"foobar"' be passed to the Windows exe and interpreted by whatever functions parse argv as "foobar". Instead, the Windows exe "sees" foobar without the double quotes. Cygwin and Msys have both solved this issue I'm guessing by adding \ to embedded double quotes before starting the Windows exe. As you can see above, I can work around this issue for now by using \" instead of " in my command arguments.

Let me know if you'd like strace output or not. Thanks!

@lukebakken
Copy link
Author

This is probably a duplicate of or related to #2164 and #1625

@benhillis
Copy link
Member

benhillis commented Aug 11, 2017

@lukebakken - Indeed, this is a duplicate of #1625, there is a fix inbound. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants