Simon Atanasyan via llvm-dev
2018-Nov-15 13:35 UTC
[llvm-dev] Tilde expression resolving wheh HOME is '/'
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
Simon Atanasyan via llvm-dev
2018-Nov-20 13:50 UTC
[llvm-dev] Tilde expression resolving wheh HOME is '/'
FYI I have submitted a review request https://reviews.llvm.org/D54752. On Thu, Nov 15, 2018 at 4:35 PM Simon Atanasyan <simon at atanasyan.com> wrote:> > 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?-- Simon Atanasyan