regedit: Correctly parse key name containing ']' when deleting/exporting.
This commit is contained in:
parent
054fd8cb42
commit
4de636208f
|
@ -449,12 +449,16 @@ LPSTR getRegKeyName(LPSTR lpLine)
|
||||||
|
|
||||||
keyNameBeg = strchr(lpLineCopy, '\\'); /* The key name start by '\' */
|
keyNameBeg = strchr(lpLineCopy, '\\'); /* The key name start by '\' */
|
||||||
if (keyNameBeg) {
|
if (keyNameBeg) {
|
||||||
LPSTR keyNameEnd;
|
|
||||||
|
|
||||||
keyNameBeg++; /* is not part of the name */
|
keyNameBeg++; /* is not part of the name */
|
||||||
keyNameEnd = strrchr(lpLineCopy, ']');
|
|
||||||
if (keyNameEnd) {
|
if (lpLine[0] == '[') /* need to find matching ']' */
|
||||||
*keyNameEnd = '\0'; /* remove ']' from the key name */
|
{
|
||||||
|
LPSTR keyNameEnd;
|
||||||
|
|
||||||
|
keyNameEnd = strrchr(lpLineCopy, ']');
|
||||||
|
if (keyNameEnd) {
|
||||||
|
*keyNameEnd = '\0'; /* remove ']' from the key name */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
keyNameBeg = lpLineCopy + strlen(lpLineCopy); /* branch - empty string */
|
keyNameBeg = lpLineCopy + strlen(lpLineCopy); /* branch - empty string */
|
||||||
|
|
Loading…
Reference in New Issue