From e7d8a9f7d234cb2b8a6691c5a2e33f2b18776a3d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 17 Jan 2022 00:05:00 -0500 Subject: simplify environment handling this temporarily breaks cd history, will fix this soon --- src/parse/ast.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/parse/ast.rs') diff --git a/src/parse/ast.rs b/src/parse/ast.rs index 88ae734..bac40c8 100644 --- a/src/parse/ast.rs +++ b/src/parse/ast.rs @@ -330,7 +330,9 @@ impl WordPart { fn eval(self, env: &Env) -> String { match self { Self::Alternation(_) => unreachable!(), - Self::Var(name) => env.var(&name), + Self::Var(name) => { + env.var(&name).unwrap_or_else(|| "".to_string()) + } Self::Bareword(s) | Self::DoubleQuoted(s) | Self::SingleQuoted(s) => s, -- cgit v1.2.3-54-g00ecf