Clear trail slash \ or/
Signed-off-by: Frank Li <lznuaa@gmail.com>
\r
return bSuccess;\r
}\r
+\r
+void CAppUtils::RemoveTrailSlash(CString &path)\r
+{\r
+ if(path.IsEmpty())\r
+ return ;\r
+ \r
+ while(path[path.GetLength()-1] == _T('\\') || path[path.GetLength()-1] == _T('/' ) )\r
+ {\r
+ path=path.Left(path.GetLength()-1);\r
+ if(path.IsEmpty())\r
+ return;\r
+ }\r
+}
\ No newline at end of file
\r
static bool CreateMultipleDirectory(CString &dir);\r
\r
+ static void RemoveTrailSlash(CString &path);\r
+\r
private:\r
static CString PickDiffTool(const CTGitPath& file1, const CTGitPath& file2);\r
static bool GetMimeType(const CTGitPath& file, CString& mimetype);\r
{\r
CAppUtils::LaunchPAgent(&dlg.m_strPuttyKeyFile);\r
}\r
+ \r
+ CAppUtils::RemoveTrailSlash(dlg.m_Directory);\r
+ CAppUtils::RemoveTrailSlash(dlg.m_URL);\r
+\r
CString dir=dlg.m_Directory;\r
CString url=dlg.m_URL;\r
+\r
// is this a windows format UNC path, ie starts with \\ \r
if (url.Find(_T("\\\\")) == 0)\r
{\r