[llvm-dev] Tilde expression resolving wheh HOME is '/'

Simon Atanasyan via llvm-dev
Thu, 15 Nov 2018 13:35:30 -0000

Hi Jonas, Zachary,

The expandTildeExpr routine and ExpandTilde unit test work
inconsistently if HOME is a root '/' folder. In that case the
expandTildeExpr resolves paths like `~/foo` into `//foo`. Double slash
looks strange, but Bash, for example, does the same thing `$ HOME=/
echo ~/foo`. But ExpandTilde unit test expects to get a normalized
`/foo` path in that case and fails.

I think we need to fix either expandTildeExpr routine or ExpandTilde
unit test. I can implement any solution, but cannot select the best
one. What do you think?

Regards,
Simon