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

Improve quoting in the preamble. #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jacobmorzinski
Copy link

On Unix, use double quotes around "$0" to protect against
the case where the script may have spaces in its name.

On Windows, the name of the batch file is in variable %0,
available as "%~f0" for a quoted fully-qualified path.
The variable %1 is the first commandline arg, and is not
the right variable for -jar or -Xbootclasspath . This patch
puts "%~f0" into the right places and removes %1 as needed.

Enhancement: for such a short preamble, putting "@echo off"
is minor overkill - it is simpler to just have a "@" at
the start of the "java" and "goto" lines.

On Unix, use double quotes around "$0" to protect against
the case where the script may have spaces in its name.

On Windows, the name of the batch file is in variable %0,
available as "%~f0" for a quoted fully-qualified path.
The variable %1 is the first commandline arg, and is not
the right variable for -jar or -Xbootclasspath . This patch
puts "%~f0" into the right places and removes %1 as needed.

Enhancement: for such a short preamble, putting "@echo off"
is minor overkill - it is simpler to just have a "@" at
the start of the "java" and "goto" lines.
@jacobmorzinski
Copy link
Author

This pull request is supposed to help with issue #24
I've tested it on Windows 10 and Ubuntu Linux, and it works for me on both.

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

Successfully merging this pull request may close these issues.

2 participants