mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
shell32: Deal better with spaces in ASSOCSTR_COMMAND values.
This commit is contained in:
parent
c89fb41f80
commit
b585b24397
1 changed files with 13 additions and 4 deletions
|
@ -320,16 +320,25 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
|
|||
{
|
||||
pszStart = pszCommand + 1;
|
||||
pszEnd = strchrW(pszStart, '"');
|
||||
if (pszEnd)
|
||||
*pszEnd = 0;
|
||||
*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pszStart = pszCommand;
|
||||
pszEnd = strchrW(pszStart, ' ');
|
||||
for (pszEnd = pszStart; (pszEnd = strchrW(pszEnd, ' ')); pszEnd++)
|
||||
{
|
||||
WCHAR c = *pszEnd;
|
||||
*pszEnd = 0;
|
||||
if ((*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL)))
|
||||
break;
|
||||
*pszEnd = c;
|
||||
}
|
||||
if (!pszEnd)
|
||||
*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
|
||||
}
|
||||
if (pszEnd)
|
||||
*pszEnd = 0;
|
||||
|
||||
*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
|
||||
HeapFree(GetProcessHeap(), 0, pszCommand);
|
||||
if (!*len)
|
||||
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
|
||||
|
|
Loading…
Reference in a new issue