diff --git a/src/parser/shell_expand/words.rs b/src/parser/shell_expand/words.rs index bc29a92b5c572c3004a5d5debdc465452d26ad50..cec56c3804b9c0ccade949875cbd964915fb10d4 100644 --- a/src/parser/shell_expand/words.rs +++ b/src/parser/shell_expand/words.rs @@ -1098,6 +1098,14 @@ impl<'a> Iterator for WordIterator<'a> { b'*'|b'?' if !self.flags.contains(SQUOTE) => { glob = true; }, + b'~' if !self.flags.intersects(SQUOTE | DQUOTE) => { + let output = &self.data[start..self.read]; + if output != "" { + return Some(WordToken::Normal(output, glob)); + } else { + return self.next(); + } + } _ => (), } self.read += 1;