From a75a26c23387761f9379a3110b2fc86ea917a49c Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 27 Oct 2008 13:59:41 -0500 Subject: [PATCH] wine: bring run dialog fix in line with winehq --- build.sh | 2 +- ...-to-guess-the-working-directory-in-the-r.patch} | 55 ++++++++++++---------- 2 files changed, 32 insertions(+), 25 deletions(-) rename patches/{0032-shell32-try-to-guess-the-working-directory-in-the-r.patch => 0032-shell32-Try-to-guess-the-working-directory-in-the-r.patch} (67%) diff --git a/build.sh b/build.sh index 50d3e5c..3f6f16f 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,7 @@ ORIG_DIR=${PWD} BUILD_DIR=$(mktemp -d) WINE_ORIGIN=git://source.winehq.org/git/wine.git WINE_BASE=07fafa26a318a3da3185fcac71bfa6d3fba82787 -WINE_COMMIT=bf59cdb61642307e01d0dc3e0fb89dff4f3b1071 +WINE_COMMIT=be293087a0ab3be50437e45cfda8be49bc4abd67 mkdir "${BUILD_DIR}"/Wine.activity diff --git a/patches/0032-shell32-try-to-guess-the-working-directory-in-the-r.patch b/patches/0032-shell32-Try-to-guess-the-working-directory-in-the-r.patch similarity index 67% rename from patches/0032-shell32-try-to-guess-the-working-directory-in-the-r.patch rename to patches/0032-shell32-Try-to-guess-the-working-directory-in-the-r.patch index 948f9da..0fedd02 100644 --- a/patches/0032-shell32-try-to-guess-the-working-directory-in-the-r.patch +++ b/patches/0032-shell32-Try-to-guess-the-working-directory-in-the-r.patch @@ -1,21 +1,17 @@ -From bf59cdb61642307e01d0dc3e0fb89dff4f3b1071 Mon Sep 17 00:00:00 2001 +From be293087a0ab3be50437e45cfda8be49bc4abd67 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 21 Oct 2008 16:07:47 -0500 -Subject: [PATCH] shell32: try to guess the working directory in the run dialog +Subject: [PATCH] shell32: Try to guess the working directory in the run dialog. -The Run dialog on Windows, when invoked from the start menu or by -passing NULL as a working directory to RunFileDlg, sets the working -directory to the parent of the file being run. Programs often rely on -the working directory so we should copy this behavior. --- - dlls/shell32/dialogs.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++- - 1 files changed, 50 insertions(+), 2 deletions(-) + dlls/shell32/dialogs.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 61 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c -index 77eea18..2e21b4f 100644 +index 77eea18..a39b392 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c -@@ -113,6 +113,47 @@ void WINAPI RunFileDlgW( +@@ -113,6 +113,58 @@ void WINAPI RunFileDlgW( } @@ -24,28 +20,39 @@ index 77eea18..2e21b4f 100644 +{ + const WCHAR *src; + WCHAR *dest, *result, *result_end=NULL; ++ static WCHAR dotexeW[] = {'.','e','x','e',0}; + -+ result = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*strlenW(cmdline)); ++ result = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5)); + + src = cmdline; + dest = result; + + if (*src == '"') -+ src++; -+ -+ while (*src) + { -+ if (*src == '\\') ++ src++; ++ while (*src && *src != '"') ++ { ++ if (*src == '\\') ++ result_end = dest; ++ *dest++ = *src++; ++ } ++ } ++ else { ++ while (*src) + { -+ DWORD attrs; -+ *dest = 0; -+ attrs = GetFileAttributesW(result); -+ if (attrs != INVALID_FILE_ATTRIBUTES && attrs & FILE_ATTRIBUTE_DIRECTORY) ++ if (isspaceW(*src)) ++ { ++ *dest = 0; ++ if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) ++ break; ++ strcatW(dest, dotexeW); ++ if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result)) ++ break; ++ } ++ else if (*src == '\\') + result_end = dest; -+ else -+ break; ++ *dest++ = *src++; + } -+ *dest++ = *src++; + } + + if (result_end) @@ -63,7 +70,7 @@ index 77eea18..2e21b4f 100644 /* Dialog procedure for RunFileDlg */ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { -@@ -158,14 +199,20 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR +@@ -158,14 +210,20 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR HWND htxt = GetDlgItem (hwnd, IDC_RUNDLG_EDITPATH); if ((ic = GetWindowTextLengthW (htxt))) { @@ -86,7 +93,7 @@ index 77eea18..2e21b4f 100644 { char *pszSysMsg = NULL ; char szMsg[256]; -@@ -191,6 +238,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR +@@ -191,6 +249,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR FillList (htxt, (LPSTR)psz, FALSE) ; HeapFree(GetProcessHeap(), 0, psz); -- 2.11.4.GIT