diff --git a/README.md b/README.md index 44d89e8d..562fc5ea 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,11 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [9]:** +**Bug fixes and features included in the next upcoming release [10]:** * Add stub for winspool.SetPrinterW level 8 ([Wine Bug #24645](https://bugs.winehq.org/show_bug.cgi?id=24645)) * Allow non-nullterminated string as working directory in kernel32.create_startup_info +* Fallback to default comspec when %COMSPEC% is not set * Fix access violation in MSYS2 git when cloning repository * Fix error handling in DeferWindowPos when passing an invalid HWND ([Wine Bug #23187](https://bugs.winehq.org/show_bug.cgi?id=23187)) * Fix failure to create anonymous file mapping after failed open_fd server call diff --git a/debian/changelog b/debian/changelog index 7c91845d..af851666 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ wine-staging (1.7.51) UNRELEASED; urgency=low * Added patch to fix SHFileOperation with FO_MOVE on Vista+ (should create non-existent subdirectories). * Added patch to silence repeated crypt32.CryptUnprotectMemory FIXMEs. + * Added patch to fallback to default comspec when %COMSPEC% is not set (fixes + Wine Staging Bug #405). * Removed patch to fix bug in wineserver debug_children inheritance (accepted upstream). * Removed patch to use helper function for NtWaitForMultipleObjects and diff --git a/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch b/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch new file mode 100644 index 00000000..87749d88 --- /dev/null +++ b/patches/kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch @@ -0,0 +1,61 @@ +From be12a69b9edfbbb091450a42a4408bc5579d1d27 Mon Sep 17 00:00:00 2001 +From: Qian Hong +Date: Sun, 26 Jul 2015 17:55:01 +0800 +Subject: kernel32: Fallback to default comspec when %COMSPEC% is not set. + +--- + dlls/kernel32/process.c | 6 +++++- + programs/cmd/wcmdmain.c | 10 ++++++++++ + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c +index b0c06e3..caa005c 100644 +--- a/dlls/kernel32/process.c ++++ b/dlls/kernel32/process.c +@@ -2174,13 +2174,17 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L + + { + static const WCHAR comspecW[] = {'C','O','M','S','P','E','C',0}; ++ static const WCHAR cmdW[] = {'\\','c','m','d','.','e','x','e',0}; + static const WCHAR slashcW[] = {' ','/','c',' ',0}; + WCHAR comspec[MAX_PATH]; + WCHAR *newcmdline; + BOOL ret; + + if (!GetEnvironmentVariableW( comspecW, comspec, sizeof(comspec)/sizeof(WCHAR) )) +- return FALSE; ++ { ++ GetSystemDirectoryW( comspec, (sizeof(comspec) - sizeof(cmdW))/sizeof(WCHAR) ); ++ strcatW( comspec, cmdW ); ++ } + if (!(newcmdline = HeapAlloc( GetProcessHeap(), 0, + (strlenW(comspec) + 4 + strlenW(cmd_line) + 1) * sizeof(WCHAR)))) + return FALSE; +diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c +index 7666329..b0ec82f 100644 +--- a/programs/cmd/wcmdmain.c ++++ b/programs/cmd/wcmdmain.c +@@ -2340,10 +2340,20 @@ int wmain (int argc, WCHAR *argvW[]) + static const WCHAR offW[] = {'O','F','F','\0'}; + static const WCHAR promptW[] = {'P','R','O','M','P','T','\0'}; + static const WCHAR defaultpromptW[] = {'$','P','$','G','\0'}; ++ static const WCHAR comspecW[] = {'C','O','M','S','P','E','C',0}; ++ static const WCHAR cmdW[] = {'\\','c','m','d','.','e','x','e',0}; ++ WCHAR comspec[MAX_PATH]; + CMD_LIST *toExecute = NULL; /* Commands left to be executed */ + OSVERSIONINFOW osv; + char osver[50]; + ++ if (!GetEnvironmentVariableW(comspecW, comspec, sizeof(comspec)/sizeof(WCHAR))) ++ { ++ GetSystemDirectoryW(comspec, (sizeof(comspec) - sizeof(cmdW))/sizeof(WCHAR)); ++ strcatW(comspec, cmdW); ++ SetEnvironmentVariableW(comspecW, comspec); ++ } ++ + srand(time(NULL)); + + /* Get the windows version being emulated */ +-- +2.5.0 + diff --git a/patches/kernel32-COMSPEC/definition b/patches/kernel32-COMSPEC/definition new file mode 100644 index 00000000..3cfee92c --- /dev/null +++ b/patches/kernel32-COMSPEC/definition @@ -0,0 +1 @@ +Fixes: Fallback to default comspec when %COMSPEC% is not set diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 9121605f..e2155d0c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -145,6 +145,7 @@ patch_enable_all () enable_inetcpl_Default_Home="$1" enable_iphlpapi_System_Ping="$1" enable_iphlpapi_TCP_Table="$1" + enable_kernel32_COMSPEC="$1" enable_kernel32_CompareStringEx="$1" enable_kernel32_CopyFileEx="$1" enable_kernel32_Cwd_Startup_Info="$1" @@ -520,6 +521,9 @@ patch_enable () iphlpapi-TCP_Table) enable_iphlpapi_TCP_Table="$2" ;; + kernel32-COMSPEC) + enable_kernel32_COMSPEC="$2" + ;; kernel32-CompareStringEx) enable_kernel32_CompareStringEx="$2" ;; @@ -3170,6 +3174,18 @@ if test "$enable_iphlpapi_TCP_Table" -eq 1; then ) >> "$patchlist" fi +# Patchset kernel32-COMSPEC +# | +# | Modified files: +# | * dlls/kernel32/process.c, programs/cmd/wcmdmain.c +# | +if test "$enable_kernel32_COMSPEC" -eq 1; then + patch_apply kernel32-COMSPEC/0001-kernel32-Fallback-to-default-comspec-when-COMSPEC-is.patch + ( + echo '+ { "Qian Hong", "kernel32: Fallback to default comspec when %COMSPEC% is not set.", 1 },'; + ) >> "$patchlist" +fi + # Patchset kernel32-CompareStringEx # | # | Modified files: