Commit b222001d authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Fixed handling of null-terminated file list in SHFileOperation.

parent c29b7c35
......@@ -791,29 +791,19 @@ static DWORD count_wildcard_files(LPCWSTR szWildFile)
static DWORD count_files(LPCWSTR szFileList)
{
DWORD dwCount = 0;
LPCWSTR p = szFileList;
LPCWSTR q = p + 1;
LPCWSTR str = p;
LPCWSTR str = szFileList;
/* test empty list */
if (!szFileList[0] && !szFileList[1])
return -1;
/* p,q search: stop when we reach double null terminator */
while (*p || *q)
{
if (!*q)
{
if (StrPBrkW(str, wWildcardChars))
dwCount += count_wildcard_files(str);
else
dwCount++;
if (!szFileList[0]) return -1;
str = q + 1;
}
while (*str)
{
if (StrPBrkW(str, wWildcardChars))
dwCount += count_wildcard_files(str);
else
dwCount++;
p++;
q++;
str += lstrlenW(str) + 1;
}
return dwCount;
......
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