On Thu, Jun 2, 2016 at 1:44 AM, Junio C Hamano <gits...@pobox.com> wrote:
>> We would
>> need to convert or match both '/' and '\' in "to/foo" case because of
>> Windows, so it's not much easier than basename().
>
> I never said "easier to implement".  But can this codepath get
> backslashed paths in the first place?  I somehow thought that
> normalization would happen a lot before the control reaches here.
>
> You'll be calling into fspathcmp() anyway; shouldn't the function
> know that '/' and '\' are equivalent on some platforms, or is it
> legal to only call fspathcmp() on a single path component without
> directory separator?

We still need to calculate the length to compare, which could be
problematic when utf-8 is involved, or some other encoding. If we
always split at '/' boundary though (e.g. "abc/def/ghi", "def/ghi" or
"ghi" but never "ef/ghi") then it should be ok.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to