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

SI-7295 Fix windows batch file with args containing parentheses #3065

Merged
merged 1 commit into from
Oct 23, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/compiler/scala/tools/ant/templates/tool-windows.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ setlocal enableextensions enabledelayedexpansion

set _LINE_TOOLCP=

:another_param

rem Use "%~1" to handle spaces in paths. See http://ss64.com/nt/syntax-args.html
if "%~1"=="-toolcp" (
set _LINE_TOOLCP=%~2
shift
shift
goto another_param
rem SI-7295 The goto here is needed to avoid problems with `scala Script.cmd "arg(with)paren"`,
rem we must not evaluate %~2 eagerly, but delayed expansion doesn't seem to allow
rem removal of quotation marks.
if not [%~1]==[-toolcp] (
goto :notoolcp
)
shift
set _LINE_TOOLCP=%~1
shift

:notoolcp

rem We keep in _JAVA_PARAMS all -J-prefixed and -D-prefixed arguments
set _JAVA_PARAMS=
Expand Down