https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f16c791548b8307ff5bdcf...
commit f16c791548b8307ff5bdcf1a306019c39868c0f6 Author: winesync ros-dev@reactos.org AuthorDate: Sun Jan 16 20:25:19 2022 +0100 Commit: Thomas Csovcsity thc.fr13nd@gmail.com CommitDate: Sun Jun 19 13:06:30 2022 +0200
[WINESYNC] reg: Simplify basic syntax checks.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id 8801118e384b7388a0fa5c43b5540bfd7f257ab6 by Hugh McMaster hugh.mcmaster@outlook.com
manual adjustments needed --- base/applications/cmdutils/reg/reg.c | 16 ++++++++++------ sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index 4645f22aec7..7f3db0fdcde 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -349,7 +349,6 @@ static enum operations get_operation(const WCHAR *str, int *op_help) int __cdecl wmain(int argc, WCHAR *argvW[]) { int i, op, op_help, ret; - BOOL show_op_help = FALSE; static const WCHAR switchVAW[] = {'v','a',0}; static const WCHAR switchVEW[] = {'v','e',0}; WCHAR *key_name, *path, *value_name = NULL, *type = NULL, *data = NULL, separator = '\0'; @@ -378,21 +377,26 @@ int __cdecl wmain(int argc, WCHAR *argvW[]) return 1; }
- if (argc > 2) - show_op_help = is_help_switch(argvW[2]); - - if (argc == 2 || ((show_op_help || op == REG_IMPORT) && argc > 3)) + else if (argc == 2) /* Valid operation, no arguments supplied */ { output_message(STRING_INVALID_SYNTAX); output_message(STRING_FUNC_HELP, _wcsupr(argvW[1])); return 1; } - else if (show_op_help) + + if (is_help_switch(argvW[2])) { output_message(op_help); return 0; }
+ if (op == REG_IMPORT && argc > 3) + { + output_message(STRING_INVALID_SYNTAX); + output_message(STRING_FUNC_HELP, wcsupr(argvW[1])); + return 1; + } + if (op == REG_IMPORT) return reg_import(argvW[2]);
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index c83a928ad45..55ca7c38a86 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: 7803c53cfe6635a5d3e0d9f58e743235746ec9d2 + wine: 8801118e384b7388a0fa5c43b5540bfd7f257ab6