diff options
Diffstat (limited to 'src/parse/ast.rs')
-rw-r--r-- | src/parse/ast.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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, |