shlwapi: Use CharNextA to iterate through characters in PathAddBackslashA. Fixes problems with MBCS paths.
This commit is contained in:
parent
53320cfc63
commit
87c3df1578
|
@ -235,6 +235,7 @@ LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
|
||||||
LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
|
LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
|
||||||
{
|
{
|
||||||
size_t iLen;
|
size_t iLen;
|
||||||
|
LPSTR prev = lpszPath;
|
||||||
|
|
||||||
TRACE("(%s)\n",debugstr_a(lpszPath));
|
TRACE("(%s)\n",debugstr_a(lpszPath));
|
||||||
|
|
||||||
|
@ -243,11 +244,15 @@ LPSTR WINAPI PathAddBackslashA(LPSTR lpszPath)
|
||||||
|
|
||||||
if (iLen)
|
if (iLen)
|
||||||
{
|
{
|
||||||
lpszPath += iLen;
|
do {
|
||||||
if (lpszPath[-1] != '\\')
|
lpszPath = CharNextA(prev);
|
||||||
|
if (*lpszPath)
|
||||||
|
prev = lpszPath;
|
||||||
|
} while (*lpszPath);
|
||||||
|
if (*prev != '\\')
|
||||||
{
|
{
|
||||||
*lpszPath++ = '\\';
|
*lpszPath++ = '\\';
|
||||||
*lpszPath = '\0';
|
*lpszPath = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lpszPath;
|
return lpszPath;
|
||||||
|
|
Loading…
Reference in New Issue