https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67493a4006273804ece9d4...
commit 67493a4006273804ece9d4c1ae2a939ed979cce3 Author: winesync ros-dev@reactos.org AuthorDate: Sun Jan 16 21:22:50 2022 +0100 Commit: Thomas Csovcsity thc.fr13nd@gmail.com CommitDate: Sun Jun 19 13:06:36 2022 +0200
[WINESYNC] reg: Fail if one or more arguments follow a help switch.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id 6c466296a7629487930d4d6e4fa7d7ae66a7bf61 by Hugh McMaster hugh.mcmaster@outlook.com
manual adjustment needed --- base/applications/cmdutils/reg/reg.c | 13 ++++++++----- modules/rostests/winetests/reg/copy.c | 8 ++++---- sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index d4c915d5c6e..7099cba594e 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -349,14 +349,12 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) return 1; } else if (argc == 2) /* Valid operation, no arguments supplied */ - { - output_message(STRING_INVALID_SYNTAX); - output_message(STRING_FUNC_HELP, _wcsupr(argvW[1])); - return 1; - } + goto invalid;
if (is_help_switch(argvW[2])) { + if (argc > 3) goto invalid; + output_message(op_help); output_message(STRING_REG_VIEW_USAGE); return 0; @@ -378,4 +376,9 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) return reg_import(argc, argvW);
return reg_query(argc, argvW); + +invalid: + output_message(STRING_INVALID_SYNTAX); + output_message(STRING_FUNC_HELP, wcsupr(argvW[1])); + return 1; } diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index ecd3cc5b29d..5ddcc2c0ffa 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -37,16 +37,16 @@ static void test_command_syntax(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
run_reg_exe("reg copy /? /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);
run_reg_exe("reg copy /h /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);
run_reg_exe("reg copy /? /s", &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 copy /h /s", &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 copy /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index ce8560ddeb3..066ee20b473 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: ac32dd8abcdd93f5428ba93c8aff7f0bb5a7c2f2 + wine: 6c466296a7629487930d4d6e4fa7d7ae66a7bf61