Hugh McMaster : reg: Exit with an error if the specified operation is invalid.

Alexandre Julliard julliard at winehq.org
Fri Jun 3 10:03:46 CDT 2016


Module: wine
Branch: master
Commit: 33d657f55ccc304744917d92e832cd55a963bbf1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=33d657f55ccc304744917d92e832cd55a963bbf1

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Fri Jun  3 05:23:39 2016 +0000

reg: Exit with an error if the specified operation is invalid.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/reg/reg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index 3ba3902..db737f7 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -939,6 +939,13 @@ int wmain(int argc, WCHAR *argvW[])
 
     op = get_operation(argvW[1]);
 
+    if (op == REG_INVALID)
+    {
+        output_message(STRING_INVALID_OPTION, argvW[1]);
+        output_message(STRING_REG_HELP);
+        return 1;
+    }
+
     if (op == REG_ADD)
     {
         WCHAR *key_name, *value_name = NULL, *type = NULL, separator = '\0', *data = NULL;




More information about the wine-cvs mailing list