[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33255: 27.0.50; expand-file-name: default directory expanded twice i

From: Paul Eggert
Subject: bug#33255: 27.0.50; expand-file-name: default directory expanded twice if relative
Date: Tue, 20 Nov 2018 12:44:25 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

On 11/20/18 11:08 AM, Glenn Morris wrote:
I had looked at that page before. Looking again, I still don't see
anything as clear-cut as "POSIX says that sh treats ~/foo like $HOME/foo
even when HOME is not absolute".

It needs to be read in context. Section 2.6.1 is about tilde expansion in the shell, e.g., how to treat commands like this:

cd ~eggert/xxx
cd ~/yyy

2.6.1 says "If the login name is null (that is, the tilde-prefix contains only the tilde), the tilde-prefix is replaced by the value of the variable /HOME."/ This is talking about the second "echo" example which uses a null login name, and it means that the second example is treated like this:

cd "$HOME"/yyy/

(The quotes are because of the last sentence in that section of the spec.) This occurs regardless of whether $HOME starts with /"/".//

reply via email to

[Prev in Thread] Current Thread [Next in Thread]