emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#10472: closed (`realpath --relative-to=<path> /` o


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#10472: closed (`realpath --relative-to=<path> /` outputs inconsistent trailing slash)
Date: Wed, 25 Jan 2012 16:56:02 +0000

Your message dated Wed, 25 Jan 2012 16:55:09 +0000
with message-id <address@hidden>
and subject line Re: bug#10472: `realpath --relative-to=<path> /` outputs 
inconsistent trailing slash
has caused the debbugs.gnu.org bug report #10472,
regarding `realpath --relative-to=<path> /` outputs inconsistent trailing slash
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
10472: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10472
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: `realpath --relative-to=<path> /` outputs inconsistent trailing slash Date: Tue, 10 Jan 2012 15:15:57 -0500 User-agent: KMail/1.13.7 (Linux/3.2.0; KDE/4.6.5; x86_64; ; )
first some examples that look fine ...

these all output the same thing:
        realpath --relative-to=/usr /usr/bin
        realpath --relative-to=/usr/ /usr/bin
        realpath --relative-to=/usr /usr/bin/
        realpath --relative-to=/usr/ /usr/bin/
which is to say, they show:
        bin

as does these:
        realpath --relative-to=/usr/bin /usr
        realpath --relative-to=/usr/bin/ /usr
        realpath --relative-to=/usr/bin /usr/
        realpath --relative-to=/usr/bin/ /usr/
which is to say, they show:
        ..

as does these:
        realpath --relative-to=/ /usr
        realpath --relative-to=/ /usr/
which is to say, they show:
        ..

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)
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---
--- Begin Message --- Subject: Re: bug#10472: `realpath --relative-to=<path> /` outputs inconsistent trailing slash Date: Wed, 25 Jan 2012 16:55:09 +0000 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0
On 01/10/2012 10:30 PM, Pádraig Brady wrote:
> On 01/10/2012 09:53 PM, Mike Frysinger wrote:
>> On Tuesday 10 January 2012 15:15:57 Mike Frysinger wrote:
>>> as does these:
>>>     realpath --relative-to=/ /usr
>>>     realpath --relative-to=/ /usr/
>>> which is to say, they show:
>>>     ..
>>
>> sorry, typo here ... these actually output:
>>      ../usr
>>
>> i guess that should be just "usr".
>> -mike
> 
> Agreed. python concurs too:
> 
>>>> os.path.relpath(start='/usr',path='/')
> '..'
>>>> os.path.relpath(start='/',path='/usr')
> 'usr'
> 
> Essentially in these edge cases the relative paths
> printed are valid, but not canonicalised.
> 
> I'll fix it up.

Proposed fix attached.

cheers,
Pádraig.

Attachment: relpath-edge-cases.diff
Description: Text document


--- End Message ---

reply via email to

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