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

calling scala.bat with arguments containing parentheses #4088

Closed
scabug opened this issue Dec 15, 2010 · 3 comments
Closed

calling scala.bat with arguments containing parentheses #4088

scabug opened this issue Dec 15, 2010 · 3 comments

Comments

@scabug
Copy link

scabug commented Dec 15, 2010

=== What steps will reproduce the problem ===
If you create a windows batch file containing a scala program and try to pass arguments containing parentheses, an error is reported.

Create, for instance, a batch file printargs.bat that contains a scala program that just prints the arguments:

::#!
@echo off
scala %0 %*
goto :eof
::!#
args foreach println

If you call it like that, the windows command line interpreter reports a syntax error:

printargs.bat "foo(bar)baz"

=== What is the expected behavior? ===
It should print

foo(bar)baz

=== What do you see instead? ===
A syntax error in scala.bat at the line

  set _ARGS=%*

=== Additional information ===

If you change scala.bat such that it passes %* directly to the java call, instead of trying to put the content into a local variable, the problem disappears. So I suggest that scala.bat should be refactored to avoid using the _ARGS variable when it is not necessary.

=== What versions of the following are you using? ===

  • Scala: 2.8.1
  • Java: 1.6.0_21-b07
  • Operating system: Windows XP
@scabug
Copy link
Author

scabug commented Dec 15, 2010

Imported From: https://issues.scala-lang.org/browse/SI-4088?orig=1
Reporter: Hans-Peter Strr (hans-peter.stoerr)
Duplicates #7295
Attachments:

  • printargs.bat (created on Dec 15, 2010 10:44:02 AM UTC, 63 bytes)

@scabug
Copy link
Author

scabug commented Mar 24, 2013

Frans W. van den Berg (vdenberg) said:
Solution in #7293 / #7295.

@scabug
Copy link
Author

scabug commented Oct 21, 2013

@retronym said:
Merging with #7295, for which I've just submitted a fix.

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

2 participants