-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow turning off brace expansion in comsubs (rhbz#1078698)
There was no check for the -B/braceexpand option before calling path_expand() to process brace expansion, making it impossible to turn off brace expansion within command substitutions. Normally the lexer flags brace expansion so that this code is not reached, but shell code within command substitutions is handled differently. Red Hat patches this by adding this check to the function itself: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20140301-fikspand.patch But I think it's more logical to patch it at the point of decision. src/cmd/ksh93/sh/macro.c: endfield(): - Decide to call either path_generate() or path_expand() based on the state of the SH_BRACEEXPAND shell option. - Fix '#if SHOPT_BRACEPAT' preprocessor check that previously hardcoded this decision at compile time. src/cmd/ksh93/tests/options.sh: - Add tests.
- Loading branch information
Showing
4 changed files
with
25 additions
and
4 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
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