From 562cd8385d5ebc4461cef15a91997dd0a4cd1666 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 22 Jan 2007 14:19:23 +0100 Subject: [PATCH] In the host:/path notation require 'host' to be at least 2 chars long. This is necessary to distinguish the notation from the DOS-style C:/path notation with a drive letter. --- connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connect.c b/connect.c index 171f34837f..d3964b8059 100644 --- a/connect.c +++ b/connect.c @@ -680,7 +680,8 @@ pid_t git_connect(int fd[2], char *url, const char *prog) path = strchr(end, c); if (c == ':') { - if (path) { + /* host must have at least 2 chars to catch DOS C:/path */ + if (path && path - end > 1) { protocol = PROTO_SSH; *path++ = '\0'; } else