-
Notifications
You must be signed in to change notification settings - Fork 3.4k
In elixir.bat some argument values are not properly quoted #13565
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
Comments
Somewhat duplicate of #13165. We are currently rewriting those scripts to powershell because the quoting rules in batch are just too complicate to manage in the long term. :) However, I think we should give your suggestions a try. We definitely quote everything that is sent to Erlang. |
Thank you! Assuming this is working well, is there a chance that the change will be backported to previous versions?
Somewhat, it might be due to Line 101 in 11a493e
Line 156 in 11a493e
The
I'll definitely be watching out for that change, I didn't have much luck and essentially given up to get startup scripts to run properly on Windows and was planning on just writing them in a compiled language or just give in and use .net. |
Let's give it a try! I pushed a PR here with your changes, feel free to poke at it: #13166 |
Elixir and Erlang/OTP versions
Operating system
Windows 11
Current behavior
When passing CLI parameter
-pa
with an argument that contains spaces, the elixir startup batch file will strip quotes andcmd.exe
will fail with an error message. This message can vary depending on how the path is constructed, for example here is the most simple reproducer I could think ofThis very likely applies to other parameters as well, like
-r
,-pa
,-pr
,-pz
, as I understand all of those take a path value, but I don't know the semanticsHere's the code in question:
elixir/bin/elixir.bat
Lines 132 to 135 in 6f84158
Here's a diff/patch of the changes I made that resolved my immediate issue (but I'm not certain it won't produce other issues, quoting in CMD is weird):
So the
%~1
removes surrounding quotes if they exist, then we add it again, now we're relatively certain that the values are quoted exactly once.Here's a related issue: #6455 though at the time this was resolved, the
-pa
et. al. worked just without the~
. That would have worked for me as well, so I'm not completely certain why the tilde was introduced.Expected behavior
The text was updated successfully, but these errors were encountered: