Fix -x command line option to skip header#5659
Merged
headius merged 1 commit intojruby:masterfrom Apr 9, 2019
Merged
Conversation
|
|
||
| boolean foundRubyShebang = false; | ||
| String currentLine; | ||
| while((currentLine = br.readLine()) != null) { |
Member
There was a problem hiding this comment.
One tiny thing: This while statement has different whitespace.
It needs a space after the while keyword to keep it the same.
Same goes for the if statements below.
(Thanks for working to imrpove JRuby!)
Contributor
Author
There was a problem hiding this comment.
Oops, you are totally right, fixed!
The -x option has been broken since [1], as parseShebangOptions is no longer run, which is responsible for calling setHasShebangLine. As this is no longer done, hasShebangLine always returns false, even if there is a valid shebang. The fix is to remove the check at this location and move it into the findScript function, which already searches for the ruby shebang. [1]: 9e2d6dc Fix: jruby#4536
9dcf510 to
4081dd9
Compare
Member
|
Failures looked like some intermittent issues we've had on all branches, so I think we can go forward with this. Did not make 9.2.7, but it's in for 9.2.8! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The -x option has been broken since 9e2d6dc, as
parseShebangOptionsis no longer run, which is responsible for callingsetHasShebangLine. As this is no longer done,hasShebangLinealways returns false, even if there is a valid shebang.The fix is to remove the check at this location and move it into the
findScriptfunction, which already searches for the ruby shebang.Like mentioned in #4536, there seems to be a test for this, but it is not run during CI (at least I couldn't find it). Also parseShebangOptions seems to be dead code, which I can also remove if you want.