https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4d8b76a2fffd45509da88655e920bd9c86277ce

commit b4d8b76a2fffd45509da88655e920bd9c86277ce
Author:     winesync <[email protected]>
AuthorDate: Sun Jan 16 20:31:21 2022 +0100
Commit:     Thomas Csovcsity <[email protected]>
CommitDate: Sun Jun 19 13:06:30 2022 +0200

    [WINESYNC] reg: Move 'import' syntax checks to reg_import().
    
    Signed-off-by: Hugh McMaster <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 4cbf47054fc7d95bcbab368fa53fc71908472309 by Hugh McMaster 
<[email protected]>
---
 base/applications/cmdutils/reg/import.c | 13 +++++++++++--
 base/applications/cmdutils/reg/reg.c    |  9 +--------
 base/applications/cmdutils/reg/reg.h    |  2 +-
 sdk/tools/winesync/reg.cfg              |  2 +-
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/base/applications/cmdutils/reg/import.c 
b/base/applications/cmdutils/reg/import.c
index 9e21bcc6a7e..13e54e6a69a 100644
--- a/base/applications/cmdutils/reg/import.c
+++ b/base/applications/cmdutils/reg/import.c
@@ -983,13 +983,22 @@ cleanup:
     return NULL;
 }
 
-int reg_import(const WCHAR *filename)
+int reg_import(int argc, WCHAR *argvW[])
 {
+    WCHAR *filename, *pos;
     FILE *fp;
     static const WCHAR rb_mode[] = {'r','b',0};
     BYTE s[2];
     struct parser parser;
-    WCHAR *pos;
+
+    if (argc > 3)
+    {
+        output_message(STRING_INVALID_SYNTAX);
+        output_message(STRING_FUNC_HELP, wcsupr(argvW[1]));
+        return 1;
+    }
+
+    filename = argvW[2];
 
     fp = _wfopen(filename, rb_mode);
     if (!fp)
diff --git a/base/applications/cmdutils/reg/reg.c 
b/base/applications/cmdutils/reg/reg.c
index 7f3db0fdcde..8a27756b974 100644
--- a/base/applications/cmdutils/reg/reg.c
+++ b/base/applications/cmdutils/reg/reg.c
@@ -390,15 +390,8 @@ int __cdecl wmain(int argc, WCHAR *argvW[])
         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]);
+        return reg_import(argc, argvW);
 
     if (op == REG_EXPORT)
         return reg_export(argc, argvW);
diff --git a/base/applications/cmdutils/reg/reg.h 
b/base/applications/cmdutils/reg/reg.h
index b29c2c21a1f..703dd0d37af 100644
--- a/base/applications/cmdutils/reg/reg.h
+++ b/base/applications/cmdutils/reg/reg.h
@@ -56,7 +56,7 @@ int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR 
*value_name,
 int reg_export(int argc, WCHAR *argv[]);
 
 /* import.c */
-int reg_import(const WCHAR *filename);
+int reg_import(int argc, WCHAR *argvW[]);
 
 /* query.c */
 int reg_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 55ca7c38a86..e1852985669 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: 8801118e384b7388a0fa5c43b5540bfd7f257ab6
+  wine: 4cbf47054fc7d95bcbab368fa53fc71908472309

Reply via email to