Re: [PATCH 1/4] Client side of user-relative paths, take two.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 2, 2005, 00:14 UTC
- Message-ID
- <7vpspj6h3n.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20051101225921.245595BF70@nox.op5.se>
Andreas Ericsson <ae@op5.se> writes:
> + if (protocol == PROTO_SSH && colon && (!path || colon < path)) {
> + *colon = 0;
> + path = colon + 1;
> + }I think "colon < path" is to cover "git://host.xz/foo/bar:baz" case (i.e. funny directory name with an embedded colon); I think you should reset colon to NULL if you do things differently later depending on colon is set or not, like this part:
Show 9 quoted lines
> + /* null-terminate host part and point path to ~ for URL's like this:
> + * ssh://host.xz/~user/repo
> + */
> + if(!colon && *(path + 1) == '~')
> + *path++ = '\0';
> + else {
> + colon = path;
> + path = strdup(path);
> + *colon = '\0';