[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10472: `realpath --relative-to=<path> /` outputs inconsistent traili
From: |
Eric Blake |
Subject: |
bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash |
Date: |
Mon, 30 Jan 2012 14:10:45 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
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 address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Mike Frysinger, 2012/01/10
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Mike Frysinger, 2012/01/10
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Pádraig Brady, 2012/01/10
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Mike Frysinger, 2012/01/10
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Pádraig Brady, 2012/01/25
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Jim Meyering, 2012/01/25
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Pádraig Brady, 2012/01/25
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Pádraig Brady, 2012/01/25
- bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash, Jim Meyering, 2012/01/25
bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash,
Eric Blake <=