Added Mailing list - ARRAY_SIZE patchset

These patches are directly from the mailing list with second
sign-off if one was provided.
This commit is contained in:
Alistair Leslie-Hughes
2018-08-03 09:28:30 +10:00
parent a7ae3783c5
commit f23105a6d8
60 changed files with 5149 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
From af37cc621e7a0c460240cc01049a10531f685e38 Mon Sep 17 00:00:00 2001
From 9d6b3e42916fbbd52a3fe9920c329dbe3d20330b Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Sun, 26 Jul 2015 17:55:01 +0800
Subject: [PATCH] kernel32: Fallback to default comspec when %COMSPEC% is not
@@ -10,10 +10,10 @@ Subject: [PATCH] kernel32: Fallback to default comspec when %COMSPEC% is not
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 91d242e..2075dfd 100644
index d9673d7..f568022 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2323,6 +2323,7 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
@@ -2325,6 +2325,7 @@ 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};
@@ -21,10 +21,10 @@ index 91d242e..2075dfd 100644
static const WCHAR slashscW[] = {' ','/','s','/','c',' ',0};
static const WCHAR quotW[] = {'"',0};
WCHAR comspec[MAX_PATH];
@@ -2330,7 +2331,10 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
@@ -2332,7 +2333,10 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
BOOL ret;
if (!GetEnvironmentVariableW( comspecW, comspec, sizeof(comspec)/sizeof(WCHAR) ))
if (!GetEnvironmentVariableW( comspecW, comspec, ARRAY_SIZE( comspec )))
- return FALSE;
+ {
+ GetSystemDirectoryW( comspec, (sizeof(comspec) - sizeof(cmdW))/sizeof(WCHAR) );
@@ -34,10 +34,10 @@ index 91d242e..2075dfd 100644
(strlenW(comspec) + 7 + strlenW(cmd_line) + 2) * sizeof(WCHAR))))
return FALSE;
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 827ddd2..9feac1a 100644
index 8fe2d57..3573885 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -2343,10 +2343,20 @@ int wmain (int argc, WCHAR *argvW[])
@@ -2348,10 +2348,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'};