Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Handle double slashes in make_relative_path()

From: Thomas Rast <hidden>
Date: 2016-06-15 22:48:05

Possibly related (same subject, not in this thread)

On Friday 22 January 2010 02:40:41 Junio C Hamano wrote:
Now what is the goal of this patch?  To allow people to have duplicated
slashes at random places in either abs or base, or is it only interested
in a particular input that is malformed?  If the latter, what is the
permitted non-canonical input?

If abs were "/a//b/c" and base were "/a/b", then the combination is
rejected by prefixcmp() and full "/a//b/c" is returned.  Is it the
intended behaviour of the patch?

I would actually have expected to see [a real fix that handles
duplicate slashes in all instances.]
It's not about *permitted* input; the problem is simply that the
current function gives back *bogus* paths, which causes git to fail.
So I only went for the minimal patch to fix this.

Not handling the abs="/a//b/c" base="/a/b" case seemed ok to me since
that was never turned as a relative "c", hence there would not be any
speed loss (nor gain) from my patch.

Does that answer the question?

As for your patch, thanks for coming up with a real fix.  I read the
amended version, and it seems correct to me.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help