kernel32: Replace command.com with cmd.exe (eterbug #7103).
authorAlexander Morozov <amorozov@etersoft.ru>
Tue, 12 Apr 2011 12:42:16 +0000 (16:42 +0400)
committerTest Robot <wine-patches-test@office.etersoft.ru>
Tue, 12 Apr 2011 13:11:30 +0000 (17:11 +0400)
dlls/kernel32/process.c

index 986f89742c25807ead82b6d607a1430785c13d65..15bc0541670292c52f6f148a2689ef403169eb0e 100644 (file)
@@ -133,6 +133,9 @@ static inline int is_special_env_var( const char *var )
  */
 static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *filename, UINT size )
 {
+    static const WCHAR commandW[] = {'c','o','m','m','a','n','d',0};
+    static const WCHAR command_comW[] = {'c','o','m','m','a','n','d','.','c','o','m',0};
+    static const WCHAR cmdW[] = {'c','m','d','.','e','x','e',0};
     WCHAR *file_part;
     UINT len = strlenW( DIR_System );
 
@@ -155,6 +158,10 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil
         if (file_part > filename && file_part[-1] != '\\') *file_part++ = '\\';
         strcpyW( file_part, libname );
     }
+    /* replace command[.com] with cmd.exe (HACK for eterbug #7103) */
+    if (!strcmpiW( file_part, commandW ) || !strcmpiW( file_part, command_comW ))
+        /* cmdW is not longer than commandW and command_comW */
+        strcpyW( file_part, cmdW );
     if (ext && !strchrW( file_part, '.' ))
     {
         if (file_part + strlenW(file_part) + strlenW(ext) + 1 > filename + size)