Uh oh!
There was an error while loading. Please reload this page.
fix(provider): a value ending in a backslash no longer vanishes - #1135
Merged
Conversation
An odd run of trailing backslashes escapes the ) that the parser's fast path appends, so eval sees args=(C:\ -- unterminated. That is a SYNTAX error, not a failed command, and a syntax error inside eval kills the enclosing command substitution. exec.sh calls the parser as <<"$(parse_data_provider_args …)", so the substitution returned nothing and the test ran with $1 unset. That is also why the parser looked fine in isolation: writing to a file it prints C: correctly, and only the in-situ call through $( ) loses it. Detect the odd trailing backslash and skip the eval path; the fallback parser already handles the input. C:\ now arrives as C:, which is what a shell would make of it. The test fails against the unfixed parser. Closes#1134
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 freeto 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.
🤔 Background
Related #1134
A provider value ending in a lone backslash reached the test unset, so the
test ran against nothing:
C:\<unset>C:💡 Root cause
An odd run of trailing backslashes escapes the
)that the parser's fast pathappends, so
evalseesargs=(C:\)— unterminated. That is a syntax error,not a failed command, and a syntax error inside
evalkills the enclosingcommand substitution.
exec.shcalls the parser as<<<"$(parse_data_provider_args "$data")", so the substitution returned nothing.It is also why the parser looked correct in isolation — writing to a file it
prints
C:fine; only the in-situ call through$( )loses it.💡 Changes
tests/functional/provider_test.sh, verified to fail against the unfixed parser