https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa84e69673bb2eef7c4fc…
commit fa84e69673bb2eef7c4fc7805fc9b3d331673c85
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Jan 16 20:25:18 2022 +0100
Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com>
CommitDate: Sun Jun 19 13:06:30 2022 +0200
[WINESYNC] reg: Use is_switch() where possible.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id ab94653e8bb093b88406f7c509c7157ac7033f28 by Hugh McMaster
<hugh.mcmaster(a)outlook.com>
---
base/applications/cmdutils/reg/export.c | 8 +-------
base/applications/cmdutils/reg/reg.c | 7 ++-----
base/applications/cmdutils/reg/reg.h | 1 +
sdk/tools/winesync/reg.cfg | 2 +-
4 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/base/applications/cmdutils/reg/export.c
b/base/applications/cmdutils/reg/export.c
index b5796d5fef3..50d27b45d37 100644
--- a/base/applications/cmdutils/reg/export.c
+++ b/base/applications/cmdutils/reg/export.c
@@ -361,13 +361,7 @@ static HANDLE get_file_handle(WCHAR *filename, BOOL overwrite_file)
static BOOL is_overwrite_switch(const WCHAR *s)
{
- if (lstrlenW(s) > 2)
- return FALSE;
-
- if ((s[0] == '/' || s[0] == '-') && (s[1] == 'y' ||
s[1] == 'Y'))
- return TRUE;
-
- return FALSE;
+ return is_switch(s, 'y');
}
int reg_export(int argc, WCHAR *argv[])
diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c
index 8be4a6e5b40..26cb3e26b96 100644
--- a/base/applications/cmdutils/reg/reg.c
+++ b/base/applications/cmdutils/reg/reg.c
@@ -289,7 +289,7 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path,
WCHAR **long
return TRUE;
}
-static BOOL is_switch(const WCHAR *s, const WCHAR c)
+BOOL is_switch(const WCHAR *s, const WCHAR c)
{
if (lstrlenW(s) > 2)
return FALSE;
@@ -302,10 +302,7 @@ static BOOL is_switch(const WCHAR *s, const WCHAR c)
static BOOL is_help_switch(const WCHAR *s)
{
- if (is_switch(s, '?') || is_switch(s, 'h'))
- return TRUE;
-
- return FALSE;
+ return (is_switch(s, '?') || is_switch(s, 'h'));
}
enum operations {
diff --git a/base/applications/cmdutils/reg/reg.h b/base/applications/cmdutils/reg/reg.h
index b14470b2cbf..4cb31c4671a 100644
--- a/base/applications/cmdutils/reg/reg.h
+++ b/base/applications/cmdutils/reg/reg.h
@@ -40,6 +40,7 @@ BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info);
HKEY path_get_rootkey(const WCHAR *path);
WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD
subkey_len);
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key);
+BOOL is_switch(const WCHAR *s, const WCHAR c);
/* add.c */
int reg_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty,
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 49526f7bef5..769f8b11b04 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: 7e7d92d5e97f89a409db0dd091419b4f1bfe7ed4
+ wine: ab94653e8bb093b88406f7c509c7157ac7033f28