forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use set -u to avoid accessing uninitialized variables
A previous version of this script was incorrectly assuming that an uninitialized variable would be initialized to a "false" value, but uninitialized variables typically evaluate to a blank string which is considered true. As a result of this, no-argument calls behaved improperly, breaking the ability to pipe code into the jruby command. This commit enables `set -u` for the JRuby launcher script, to trigger an error whenever an uninitialized variable is accessed. Variables we expect to possibly be uninitialized (such as various JAVA variables used to override the location of the java command) have been modified to use the ${variable-} format that does not trigger an error.
- Loading branch information
Showing
1 changed file
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters