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

Re: [PATCH] clone: allow cloning local paths with colons in them

From: Eric Sunshine <hidden>
Date: 2016-06-15 22:57:03

On Sat, Apr 27, 2013 at 8:19 PM, Duy Nguyen [off-list ref] wrote:
On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano [off-list ref] wrote:
quoted
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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help