https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb66fe28bae4a52fff2d1…
commit cb66fe28bae4a52fff2d1b3ca5e70a19978351ad
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 20:48:04 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:31 2022 +0200
[WINESYNC] reg: Fail if duplicate command-line switches are passed to 'reg
add'.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 08976b3ee0db827bc5add829de1f148da89a6362 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/add.c | 4 +++-
modules/rostests/winetests/reg/add.c | 4 ++--
sdk/tools/winesync/reg.cfg | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/base/applications/cmdutils/reg/add.c b/base/applications/cmdutils/reg/add.c
index 672ec19ef98..29ac0e88af5 100644
--- a/base/applications/cmdutils/reg/add.c
+++ b/base/applications/cmdutils/reg/add.c
@@ -227,6 +227,7 @@ int reg_add(int argc, WCHAR *argvW[])
if (!lstrcmpiW(str, L"ve"))
{
+ if (value_empty) goto invalid;
value_empty = TRUE;
continue;
}
@@ -249,11 +250,12 @@ int reg_add(int argc, WCHAR *argvW[])
break;
case 's':
str = argvW[++i];
- if (!str || lstrlenW(str) != 1)
+ if (separator || !str || lstrlenW(str) != 1)
goto invalid;
separator = str[0];
break;
case 'f':
+ if (force) goto invalid;
force = TRUE;
break;
default:
diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c
index f5d473e8887..e1e7a478502 100644
--- a/modules/rostests/winetests/reg/add.c
+++ b/modules/rostests/winetests/reg/add.c
@@ -234,7 +234,7 @@ static void test_add(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /f /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey);
@@ -295,7 +295,7 @@ static void test_add(void)
verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /f /ve", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /d WineTEST
/f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index df540a629f6..be7ad220b82 100644
--- a/sdk/tools/winesync/reg.cfg
+++ b/sdk/tools/winesync/reg.cfg
@@ -4,4 +4,4 @@ directories:
files:
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
tags:
- wine: 9138f5893c2eb7cafabdd8ed49b99a633eeda462
+ wine: 08976b3ee0db827bc5add829de1f148da89a6362