Re: [PATCH] clone: allow cloning local paths with colons in them
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 28, 2013, 02:15 UTC
- Message-ID
- <CACsJy8Brw8h6uL91NpE8S6o2K0HWQfWE0ghBEWg-QbfAZOT-FQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cQ+XQYyg2ihvfbZeSApBfWqpLYtq58Jv3iagS5w_iHXbQ@mail.gmail.com>
On Sun, Apr 28, 2013 at 8:48 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 20 quoted lines
> On Sat, Apr 27, 2013 at 8:19 PM, Duy Nguyen <pclouds@gmail.com> wrote:
>> On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> That was fairly hard to grok. Is that equivalent to this?
>>>
>>> if (c == ':' && path < strchrnul(host, '/')) {
>>> /* is the first slash past the colon? */
>>> protocol = PROTO_SSH;
>>> *path++ = '\0';
>>> } else {
>>> path = end;
>>> }
>>>
>>
>> The original code is already hard to grok so I may be mistaken here.
>> But I think it's not the same. For the case when c == '/', it will do
>> "path = end;", which is unintended. It should keep the current "path"
>> value (i.e. == strchr(end, '/')). The use of "strchrnul(host, '/')" is
>> good though.
>
> Do you want to take Windows '\' into account also?Windows path does not allow ':' so it's a non-issue in the first place. -- Duy