-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: support subshells with FuncEnviron as Env
FuncEnviron can't support listing all env vars via Environ.Each, and Runner.Subshell relied on that to make a full copy of an Environ. Instead of trying to make the full copy upfront, which might not work, the runner now makes a copy of each variable value in setVar when it is about to be modified, to prevent subshells from modifying the values in the parent shell. This method is still not perfect, hence the added TODOs, but it's certainly more correct as we fix a significant footgun. Fixes #1043.
- Loading branch information
Showing
3 changed files
with
30 additions
and
34 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