GNU bug report logs -
#10472
`realpath --relative-to=<path> /` outputs inconsistent trailing slash
Previous Next
Reported by: Mike Frysinger <vapier <at> gentoo.org>
Date: Tue, 10 Jan 2012 20:17:02 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #37 received at 10472 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 01/10/2012 01:15 PM, Mike Frysinger wrote:
> however, if the last argument is just the root path:
> realpath --relative-to=/usr /
> realpath --relative-to=/usr/ /
> we end up with a trailing slash:
> ../
>
> for consistency, i don't think that should be the case
>
> (reported by Ulrich Müller via https://bugs.gentoo.org/398339)
Another bug, on a system where // is distinct from /:
$ realpath --relative-to=/ //machine / // /bin
machine
.
.
bin
$ realpath --relative-to=// //machine / // /bin
machine
.
.
bin
when it should really be:
$ realpath --relative-to=/ //machine / // /bin
//machine
.
//
bin
$ realpath --relative-to=// //machine / // /bin
machine
/
.
/bin
We need to make realpath robust to correct leading // handling; I don't
know if we should follow the lead of 'dirname' in only doing it on
machines where // is special, or if it is easier to make it honor POSIX
by special-casing // everywhere even on machines where / and // are
identical.
--
Eric Blake eblake <at> redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 13 years and 75 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.