From: Jochen Tucht Date: Sun, 13 Mar 2005 19:05:54 +0000 (+0000) Subject: Fix bug [1162369] short path name problem X-Git-Tag: 2.16.5~6124 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=26bd8e118710c9e37d41697c2e3fc0f12b5cd361;p=winmerge-jp%2Fwinmerge-jp.git Fix bug [1162369] short path name problem --- diff --git a/Src/paths.cpp b/Src/paths.cpp index 9540fc9c8..e55b433e3 100644 --- a/Src/paths.cpp +++ b/Src/paths.cpp @@ -95,11 +95,8 @@ static bool GetDirName(const CString & sDir, CString& sName) */ CString paths_GetLongPath(const CString & sPath) { - // This used to be an argument, but it was no longer fully implemented - DIRSLASH_TYPE dst = DIRSLASH; - - int len = sPath.GetLength(); - if (len < 1) return sPath; + int len = sPath.GetLength(); + if (len < 1) return sPath; TCHAR fullPath[_MAX_PATH] = {0}; TCHAR *lpPart; @@ -171,22 +168,22 @@ CString paths_GetLongPath(const CString & sPath) // advance to next component (or set ptr==0 to flag end) ptr = (end ? end+1 : 0); - CString sNextName; - if (!GetDirName(sTemp, sNextName)) + // (Couldn't get info for just the directory from CFindFile) + WIN32_FIND_DATA ffd; + HANDLE h = FindFirstFile(sTemp, &ffd); + if (h == INVALID_HANDLE_VALUE) { sLong = sTemp; if (ptr) - sLong += (CString)_T("\\") + ptr; - // No trailing slash no matter dst setting - // because it (requested path) doesn't exist + { + sLong += '\\'; + sLong += ptr; + } return sLong; } sLong += '\\'; - sLong += sNextName; - if (dst == DIRSLASH && !ptr) - { - sLong += '\\'; - } + sLong += ffd.cFileName; + FindClose(h); } return sLong; }