Module Name: src Committed By: kre Date: Fri Jul 12 08:35:48 UTC 2024
Modified Files: src/bin/sh: parser.c parser.h Log Message: Implement expandvar() : runs var/arith/cmdsub expansions on var value expandvar() is like expandenv() and expandstr() - each expands variable values in different contexts, expandenv() when processing environment vars at startup (and there is no existing state to lose), but is always using unsafe data, so never runs command substitutions, expandstr() while in the middle of processing commands (mostly to expand the prompt variables, so there is probably half a command tree in the process of being built) - it uses the promptcmds option to decide whether to run command substitutions. expandvar() is for intermediate situations, where a variable is to be used during processing. It will run command substitutions if the variable value concerned was not imported from the environment. There are currently no uses of expandvar(), so this change alters nothing in the shell - but there will be in the near future. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/bin/sh/parser.c cvs rdiff -u -r1.28 -r1.29 src/bin/sh/parser.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.