OSDN Git Service

Add Reversfind return value check at submodule updater
authorFrank Li <lznuaa@gmail.com>
Sun, 27 Sep 2009 07:53:27 +0000 (15:53 +0800)
committerFrank Li <lznuaa@gmail.com>
Sun, 27 Sep 2009 07:53:27 +0000 (15:53 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Commands/SubmoduleCommand.cpp

index ca1ea08..69c387b 100644 (file)
@@ -74,7 +74,9 @@ bool SubmoduleCommand::Execute(CString cmd,  CString arg)
        else\r
        {\r
                bkpath=this->orgPathList[0].GetWinPathString();\r
-               bkpath=bkpath.Left(bkpath.ReverseFind(_T('\\')));\r
+               int start = bkpath.ReverseFind(_T('\\'));\r
+               if( start >= 0 )\r
+                       bkpath=bkpath.Left(start);\r
        }\r
 \r
        CString super=g_GitAdminDir.GetSuperProjectRoot( bkpath );\r