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

commit fa6d473e3dd8bafb074ca37c93eff3a13b5598f6
Author:     winesync <[email protected]>
AuthorDate: Sun Jan 16 21:06:05 2022 +0100
Commit:     Thomas Csovcsity <[email protected]>
CommitDate: Sun Jun 19 13:06:32 2022 +0200

    [WINESYNC] reg: Abort 'delete' operation when parsing command-line 
arguments that are not switches.
    
    Signed-off-by: Hugh McMaster <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 51e83dec2959ce332264223832abc1a5f09dbf34 by Hugh McMaster 
<[email protected]>
---
 base/applications/cmdutils/reg/delete.c | 60 +++++++++++++++++----------------
 sdk/tools/winesync/reg.cfg              |  2 +-
 2 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/base/applications/cmdutils/reg/delete.c 
b/base/applications/cmdutils/reg/delete.c
index 519d4b880ec..b23b14e8dab 100644
--- a/base/applications/cmdutils/reg/delete.c
+++ b/base/applications/cmdutils/reg/delete.c
@@ -118,38 +118,40 @@ int reg_delete(int argc, WCHAR *argvW[])
 
     for (i = 3; i < argc; i++)
     {
-        if (argvW[i][0] == '/' || argvW[i][0] == '-')
-        {
-            WCHAR *str = &argvW[i][1];
+        WCHAR *str;
 
-            if (!lstrcmpiW(str, L"va"))
-            {
-                if (value_all) goto invalid;
-                value_all = TRUE;
-                continue;
-            }
-            else if (!lstrcmpiW(str, L"ve"))
-            {
-                if (value_empty) goto invalid;
-                value_empty = TRUE;
-                continue;
-            }
-            else if (!str[0] || str[1])
-                goto invalid;
+        if (argvW[i][0] != '/' && argvW[i][0] != '-')
+            goto invalid;
 
-            switch (towlower(*str))
-            {
-            case 'v':
-                if (value_name || !(value_name = argvW[++i]))
-                    goto invalid;
-                break;
-            case 'f':
-                if (force) goto invalid;
-                force = TRUE;
-                break;
-            default:
+        str = &argvW[i][1];
+
+        if (!lstrcmpiW(str, L"va"))
+        {
+            if (value_all) goto invalid;
+            value_all = TRUE;
+            continue;
+        }
+        else if (!lstrcmpiW(str, L"ve"))
+        {
+            if (value_empty) goto invalid;
+            value_empty = TRUE;
+            continue;
+        }
+        else if (!str[0] || str[1])
+            goto invalid;
+
+        switch (towlower(*str))
+        {
+        case 'v':
+            if (value_name || !(value_name = argvW[++i]))
                 goto invalid;
-            }
+            break;
+        case 'f':
+            if (force) goto invalid;
+            force = TRUE;
+            break;
+        default:
+            goto invalid;
         }
     }
 
diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg
index 354fb6013b0..5454758d744 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: b2ead1ffcc8d28b488b561e8c5a9e3cc964699a3
+  wine: 51e83dec2959ce332264223832abc1a5f09dbf34

Reply via email to