Don't consider ~foo constant.

This commit is contained in:
Vidar Holen 2016-09-24 15:32:44 -07:00
parent 868d53af95
commit cd4896192c
2 changed files with 4 additions and 3 deletions

View file

@ -55,6 +55,8 @@ isGlob _ = False
-- Is this shell word a constant?
isConstant token =
case token of
-- This ignores some cases like ~"foo":
T_NormalWord _ (T_Literal _ ('~':_) : _) -> False
T_NormalWord _ l -> all isConstant l
T_DoubleQuoted _ l -> all isConstant l
T_SingleQuoted _ _ -> True