[ros-diffs] [cwittich] 31107: regedit: Correctly parse key name containing ']' when deleting/exporting. <thestig at google.com>

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Dec 9 16:34:15 CET 2007


Author: cwittich
Date: Sun Dec  9 18:34:14 2007
New Revision: 31107

URL: http://svn.reactos.org/svn/reactos?rev=31107&view=rev
Log:
regedit: Correctly parse key name containing ']' when deleting/exporting. <thestig at google.com>

Modified:
    trunk/reactos/base/applications/regedit/regproc.c

Modified: trunk/reactos/base/applications/regedit/regproc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/regproc.c?rev=31107&r1=31106&r2=31107&view=diff
==============================================================================
--- trunk/reactos/base/applications/regedit/regproc.c (original)
+++ trunk/reactos/base/applications/regedit/regproc.c Sun Dec  9 18:34:14 2007
@@ -441,12 +441,14 @@
 
     keyNameBeg = strchr(lpLineCopy, '\\');    /* The key name start by '\' */
     if (keyNameBeg) {
-        LPSTR keyNameEnd;
-
-        keyNameBeg++;                             /* is not part of the name */
-        keyNameEnd = strchr(lpLineCopy, ']');
-        if (keyNameEnd) {
-            *keyNameEnd = '\0';               /* remove ']' from the key name */
+        if (lpLine[0] == '[') /* need to find matching ']' */
+        {
+            LPSTR keyNameEnd;
+
+            keyNameEnd = strrchr(lpLineCopy, ']');
+            if (keyNameEnd) {
+                *keyNameEnd = '\0';               /* remove ']' from the key name */
+            }
         }
     } else {
         keyNameBeg = lpLineCopy + strlen(lpLineCopy); /* branch - empty string */




More information about the Ros-diffs mailing list