Module: wine Branch: master Commit: 17d606a3b9f393fdf40ba69d6b591dea25656c4b URL: http://source.winehq.org/git/wine.git/?a=commit;h=17d606a3b9f393fdf40ba69d6b...
Author: Hugh McMaster hugh.mcmaster@outlook.com Date: Mon Jun 6 05:32:16 2016 +0000
reg: Move duplicate /v, /ve and /va combination checks to wmain.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/reg/reg.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/programs/reg/reg.c b/programs/reg/reg.c index ea77426..84818da 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -350,12 +350,6 @@ static int reg_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty, { HKEY key;
- if (value_name && value_empty) - { - output_message(STRING_INVALID_CMDLINE); - return 1; - } - if (RegCreateKeyW(root, path, &key) != ERROR_SUCCESS) { output_message(STRING_INVALID_KEY); @@ -416,12 +410,6 @@ static int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name { HKEY key;
- if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all)) - { - output_message(STRING_INVALID_CMDLINE); - return 1; - } - if (!force) { BOOL ret; @@ -808,12 +796,6 @@ static int reg_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, WCHAR newlineW[] = {'\n',0}; int ret;
- if (value_name && value_empty) - { - output_message(STRING_INVALID_CMDLINE); - return 1; - } - if (RegOpenKeyExW(root, path, 0, KEY_READ, &key) != ERROR_SUCCESS) { output_message(STRING_CANNOT_FIND); @@ -990,6 +972,12 @@ int wmain(int argc, WCHAR *argvW[]) force = TRUE; }
+ if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all)) + { + output_message(STRING_INVALID_CMDLINE); + return 1; + } + if (op == REG_ADD) ret = reg_add(root, path, value_name, value_empty, type, separator, data, force); else if (op == REG_DELETE)