OSDN Git Service

fixed issues with status (and icon overlays) in root directories
[tortoisegit/TortoiseGitJp.git] / src / TGitCache / CachedDirectory.cpp
index 6460789..c85ae6e 100644 (file)
@@ -409,8 +409,11 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTGitPath& path, bo
                        CString s = m_directoryPath.GetDirectory().GetWinPathString();\r
                        if (s.GetLength() > sProjectRoot.GetLength())\r
                        {\r
-                               sSubPath = s.Right(s.GetLength() - sProjectRoot.GetLength() - 1/*otherwise it gets initial slash*/);\r
+                               sSubPath = s.Right(s.GetLength() - sProjectRoot.GetLength());\r
                                lpszSubPath = sSubPath;\r
+                               // skip initial slash if necessary\r
+                               if (*lpszSubPath == _T('\\'))\r
+                                       lpszSubPath++;\r
                        }\r
 //MessageBoxA(NULL, CStringA(sProjectRoot), sSubPath, MB_OK);\r
 //OutputDebugStringA("###");OutputDebugStringW(sProjectRoot);OutputDebugStringA(" - ");OutputDebugStringA(sSubPath);OutputDebugStringA("\r\n");\r