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/r... ============================================================================== --- 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 */