Rebase against 6c5d17af07a318d754c0c21023b2d162a0d3725d.

This commit is contained in:
Alistair Leslie-Hughes
2024-06-22 17:37:43 +10:00
parent 5ecb89298f
commit 593249dcde
5 changed files with 44 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
From 8dcb8ee100c5f81cef92ec98376288253b021f6a Mon Sep 17 00:00:00 2001
From f0248f536027bb22efae2f92e180046c075a87c1 Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us@edmeades.me.uk>
Date: Tue, 16 Jul 2019 13:49:18 +1000
Subject: [PATCH] cmd: Support for launching programs based on file association
@@ -15,10 +15,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
1 file changed, 102 insertions(+), 37 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 5f1a94b39b3..487be39c954 100644
index ce083e710f7..2aad90e350d 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1385,8 +1385,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1483,8 +1483,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* 1. If extension supplied, see if that file exists */
if (extensionsupplied) {
@@ -30,7 +30,7 @@ index 5f1a94b39b3..487be39c954 100644
}
}
@@ -1416,6 +1418,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1514,6 +1516,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
}
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
@@ -38,7 +38,7 @@ index 5f1a94b39b3..487be39c954 100644
found = TRUE;
thisExt = NULL;
}
@@ -1437,52 +1440,114 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1535,52 +1538,114 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* Special case BAT and CMD */
if (ext && (!wcsicmp(ext, L".bat") || !wcsicmp(ext, L".cmd"))) {
BOOL oldinteractive = interactive;
@@ -158,7 +158,7 @@ index 5f1a94b39b3..487be39c954 100644
- if (!interactive || (console && !HIWORD(console)))
- WaitForSingleObject (pe.hProcess, INFINITE);
- GetExitCodeProcess (pe.hProcess, &exit_code);
- errorlevel = (exit_code == STILL_ACTIVE) ? 0 : exit_code;
- errorlevel = (exit_code == STILL_ACTIVE) ? NO_ERROR : exit_code;
+ if (!status) {
+ WINE_TRACE("Failed to launch via CreateProcess, rc %d (%ld)\n",
+ status, GetLastError());

View File

@@ -1,7 +1,7 @@
From 7bb9825d921f91be01144110f6478a0c017cbd79 Mon Sep 17 00:00:00 2001
From 2f9fa2d492521d297eb87e4b6709d8349818b9c6 Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us@edmeades.me.uk>
Date: Tue, 16 Jul 2019 13:51:58 +1000
Subject: [PATCH 2/2] cmd: ftype failed to clear file associations
Subject: [PATCH] cmd: ftype failed to clear file associations
If a file association was set (e.g. ftype fred=xxx), ftype fred= needs to clear it,
but previously it failed to do so.
@@ -12,10 +12,10 @@ but previously it failed to do so.
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 62ae19a494..e85e553c05 100644
index 1c39c35ca78..f23f9ef2046 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -4939,11 +4939,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
@@ -4101,11 +4101,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
/* If nothing after '=' then clear value - only valid for ASSOC */
if (*newValue == 0x00) {
@@ -28,13 +28,13 @@ index 62ae19a494..e85e553c05 100644
- } else if (assoc && rc != ERROR_FILE_NOT_FOUND) {
+ } else if (rc != ERROR_FILE_NOT_FOUND) {
WCMD_print_error();
errorlevel = 2;
errorlevel = ERROR_FILE_NOT_FOUND;
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index f4dfc9f26d..0ef049a4ab 100644
index d5397560bc6..14666c85cac 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -2440,6 +2440,12 @@ echo echo +++>> tmp.cmd
@@ -2670,6 +2670,12 @@ echo echo +++>> tmp.cmd
echo ftype footype>> tmp.cmd
cmd /c tmp.cmd
@@ -47,7 +47,7 @@ index f4dfc9f26d..0ef049a4ab 100644
echo --- resetting association
assoc .foo=
@@ -2471,6 +2477,9 @@ echo .foo=footype
@@ -2701,6 +2707,9 @@ echo .foo=footype
echo footype=foo_opencmd
echo +++
echo footype=foo_opencmd
@@ -58,10 +58,10 @@ index f4dfc9f26d..0ef049a4ab 100644
echo original value
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index d78d91a6cf..e6ebe06714 100644
index 0102c3bcbc5..a6d97bc8248 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -1444,8 +1444,11 @@ footype=foo_opencmd
@@ -1549,8 +1549,11 @@ footype=foo_opencmd
footype=foo_opencmd
+++
footype=foo_opencmd
@@ -75,5 +75,5 @@ index d78d91a6cf..e6ebe06714 100644
--- external script
foo@space@
--
2.17.1
2.43.0