shell32: deal better with spaces in ASSOCSTR_COMMAND values

Damjan Jovanovic damjan.jov at gmail.com
Wed Nov 18 13:13:00 CST 2009


Changelog:
* shell32: deal better with spaces in ASSOCSTR_COMMAND values

This finds the real application name (instead of "A Wine application")
more often in winemenubuilder for Wine's freedesktop.org MIME type
handlers. Idea taken from a part of shlexec.c's SHELL_execute.

Damjan Jovanovic
-------------- next part --------------
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index bf9ccb9..904a1a9 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -324,7 +324,14 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
   else
   {
     pszStart = pszCommand;
-    pszEnd = strchrW(pszStart, ' ');
+    for (pszEnd = pszStart; (pszEnd = strchrW(pszEnd, ' ')); pszEnd++)
+    {
+      WCHAR c = *pszEnd;
+      *pszEnd = 0;
+      if (SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL))
+        break;
+      *pszEnd = c;
+    }
   }
   if (pszEnd)
     *pszEnd = 0;


More information about the wine-patches mailing list