From e4e4145ae2db82739ad023fd8d4483b36ee52e30 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Sun, 27 Sep 2009 15:53:27 +0800 Subject: [PATCH] Add Reversfind return value check at submodule updater Signed-off-by: Frank Li --- src/TortoiseProc/Commands/SubmoduleCommand.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/Commands/SubmoduleCommand.cpp b/src/TortoiseProc/Commands/SubmoduleCommand.cpp index ca1ea082d..69c387b65 100644 --- a/src/TortoiseProc/Commands/SubmoduleCommand.cpp +++ b/src/TortoiseProc/Commands/SubmoduleCommand.cpp @@ -74,7 +74,9 @@ bool SubmoduleCommand::Execute(CString cmd, CString arg) else { bkpath=this->orgPathList[0].GetWinPathString(); - bkpath=bkpath.Left(bkpath.ReverseFind(_T('\\'))); + int start = bkpath.ReverseFind(_T('\\')); + if( start >= 0 ) + bkpath=bkpath.Left(start); } CString super=g_GitAdminDir.GetSuperProjectRoot( bkpath ); -- 2.11.4.GIT