Commit 87c3df15 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

shlwapi: Use CharNextA to iterate through characters in PathAddBackslashA. Fixes…

shlwapi: Use CharNextA to iterate through characters in PathAddBackslashA. Fixes problems with MBCS paths.
parent 53320cfc
......@@ -235,6 +235,7 @@ LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
{
size_t iLen;
LPSTR prev = lpszPath;
TRACE("(%s)\n",debugstr_a(lpszPath));
......@@ -243,11 +244,15 @@ LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
if (iLen)
{
lpszPath += iLen;
if (lpszPath[-1] != '\\')
do {
lpszPath = CharNextA(prev);
if (*lpszPath)
prev = lpszPath;
} while (*lpszPath);
if (*prev != '\\')
{
*lpszPath++ = '\\';
*lpszPath = '\0';
*lpszPath++ = '\\';
*lpszPath = '\0';
}
}
return lpszPath;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment