[WINESYNC] reg: Use is_switch() where possible.

Signed-off-by: Hugh McMaster <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>

wine commit id ab94653e8bb093b88406f7c509c7157ac7033f28 by Hugh McMaster <[email protected]>
This commit is contained in:
winesync
2022-06-19 13:06:30 +02:00
committed by Thomas Csovcsity
parent bcb87edb6a
commit fa84e69673
4 changed files with 5 additions and 13 deletions
+1 -7
View File
@@ -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[])
+2 -5
View File
@@ -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 {
+1
View File
@@ -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,
+1 -1
View File
@@ -4,4 +4,4 @@ directories:
files:
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
tags:
wine: 7e7d92d5e97f89a409db0dd091419b4f1bfe7ed4
wine: ab94653e8bb093b88406f7c509c7157ac7033f28