shell32 patch 23j

Martin Fuchs martin-fuchs at gmx.net
Fri Apr 9 09:00:15 CDT 2004


Changelog:
eliminate duplicate string constants


Index: shlexec.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlexec.c,v
retrieving revision 1.40
diff -u -p -d -r1.40 shlexec.c
--- shlexec.c	7 Apr 2004 03:49:51 -0000	1.40
+++ shlexec.c	9 Apr 2004 13:59:10 -0000
@@ -58,6 +58,7 @@ static const WCHAR wszExe[] = {'.','e','
 static const WCHAR wszILPtr[] = {':','%','p',0};
 static const WCHAR wszShell[] = {'\\','s','h','e','l','l','\\',0};
 static const WCHAR wszFolder[] = {'F','o','l','d','e','r',0};
+static const WCHAR wszCommand[] = {'\\','c','o','m','m','a','n','d',0};
 static const WCHAR wszEmpty[] = {0};
 
 
@@ -449,12 +450,10 @@ end:
 
 static UINT SHELL_FindExecutableByOperation(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command, LONG commandlen)
 {
-    static const WCHAR wCommand[] = {'\\','c','o','m','m','a','n','d',0};
-
     /* Looking for ...buffer\shell\<verb>\command */
     strcatW(filetype, wszShell);
     strcatW(filetype, lpOperation);
-    strcatW(filetype, wCommand);
+    strcatW(filetype, wszCommand);
 
     if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, command,
                        &commandlen) == ERROR_SUCCESS)
@@ -474,7 +473,7 @@ static UINT SHELL_FindExecutableByOperat
          */
 	/* Get the parameters needed by the application
 	   from the associated ddeexec key */
-	tmp = strstrW(filetype, wCommand);
+	tmp = strstrW(filetype, wszCommand);
 	tmp[0] = '\0';
 	strcatW(filetype, wDdeexec);
 	if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, param,
@@ -822,7 +821,6 @@ static UINT execute_from_key(LPWSTR key,
     /* Get the application for the registry */
     if (RegQueryValueW(HKEY_CLASSES_ROOT, key, cmd, &cmdlen) == ERROR_SUCCESS)
     {
-	static const WCHAR wCommand[] = {'c','o','m','m','a','n','d',0};
 	static const WCHAR wDdeexec[] = {'d','d','e','e','x','e','c',0};
         LPWSTR tmp;
         WCHAR param[256];
@@ -832,7 +830,7 @@ static UINT execute_from_key(LPWSTR key,
 
         /* Get the parameters needed by the application
            from the associated ddeexec key */
-        tmp = strstrW(key, wCommand);
+        tmp = strstrW(key, wszCommand);
         assert(tmp);
         strcpyW(tmp, wDdeexec);
 
@@ -1143,8 +1141,6 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEX
     }
     else if (PathIsURLW((LPWSTR)lpFile))    /* File not found, check for URL */
     {
-	static const WCHAR wShell[] = {'\\','s','h','e','l','l','\\',0};
-	static const WCHAR wCommand[] = {'\\','c','o','m','m','a','n','d',0};
         LPWSTR lpstrRes;
         INT iSize;
 
@@ -1160,7 +1156,7 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEX
         lpstrProtocol[iSize] = '\0';
         strcatW(lpstrProtocol, wShell);
         strcatW(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen);
-        strcatW(lpstrProtocol, wCommand);
+        strcatW(lpstrProtocol, wszCommand);
 
         /* Remove File Protocol from lpFile */
         /* In the case file://path/file     */





More information about the wine-patches mailing list