-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syntax: backquotes affect backslashes in single quotes too
I incorrectly understood that backquote command substitutions did not affect backslashes in single quotes. For example, $ echo `echo "1.2" | sed -e 's/\./\\\\./g'` 1\.2 would be formatted by shfmt as the following, with different output: $ echo $(echo "1.2" | sed -e 's/\./\\\\./g') 1\\.2 when in fact we do want to deduplicate the backslashes: $ echo $(echo "1.2" | sed -e 's/\./\\./g') 1\.2 Tweak the existing test which expected the wrong result. Thankfully, we simplify the code now with the fix. Fixes #1041.
- Loading branch information
Showing
3 changed files
with
10 additions
and
17 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
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
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