GNU bug report logs -
#33255
27.0.50; expand-file-name: default directory expanded twice if relative
Previous Next
Reported by: immerrr again <immerrr <at> gmail.com>
Date: Sun, 4 Nov 2018 10:56:02 UTC
Severity: minor
Fixed in version 27.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #40 received at 33255 <at> debbugs.gnu.org (full text, mbox):
On 11/20/18 11:08 AM, Glenn Morris wrote:
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_01
> 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 /"/".//
/
This bug report was last modified 6 years and 261 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.