From 4c31449a6505f802fe990014cc9aa095e3fa2f60 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 30 Jul 2014 19:17:04 +0100 Subject: [PATCH] Add access to specific env vars in %val{...} evaluation --- src/command_manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/command_manager.cc b/src/command_manager.cc index 81cd1c02..c1d43e2e 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -323,7 +323,12 @@ String eval_token(const Token& token, Context& context, case Token::Type::OptionExpand: return context.options()[content].get_as_string(); case Token::Type::ValExpand: + { + auto it = env_vars.find(content); + if (it != env_vars.end()) + return it->second; return ShellManager::instance().get_val(content, context); + } case Token::Type::RawEval: return eval(content, context, shell_params, env_vars); case Token::Type::Raw: