From e928a1d2217f35a140a157e253b9ab96c3b429d8 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Mon, 18 Mar 2013 22:52:56 +0800 Subject: [PATCH] Do not remove the trailing slash of URL if has it no path component This allows to clone git://192.168.1.5/ Signed-off-by: Sup Yut Sum --- src/TortoiseProc/AppUtils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 492b05685..a37ea7de3 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -2557,6 +2557,16 @@ void CAppUtils::RemoveTrailSlash(CString &path) if(path.IsEmpty()) return ; + // For URL, do not trim the slash just after the host name component. + int index = path.Find(_T("://")); + if (index >= 0) + { + index += 4; + index = path.Find(_T('/'), index); + if (index == path.GetLength() - 1) + return; + } + while(path[path.GetLength()-1] == _T('\\') || path[path.GetLength()-1] == _T('/' ) ) { path=path.Left(path.GetLength()-1); -- 2.11.4.GIT