Previously we parsed -[...] to delete a registry key, but this is not
correct. It should be [-...]. Reference:
http://support.microsoft.com/kb/310516
https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#.REG_files
# Ignore comments.
next if /^\s*;/;
- # Expect to see [...] or -[...]
+ # Expect to see [...] or [-...]
# to merge or delete a node respectively.
- if (/^\[(.*)\]\s*$/) {
+ if (/^\[-(.*)\]\s*$/) {
+ _delete_node ($hmap, \%params, $1);
+ $state = "outer";
+ } elsif (/^\[(.*)\]\s*$/) {
$state = "inner";
$newnode = $1;
@newvalues = ();
@delvalues = ();
- } elsif (/^-\[(.*)\]\s*$/) {
- _delete_node ($hmap, \%params, $1);
- $state = "outer";
} else {
croak (_unexpected ($_, $lineno));
}
[\A]
@="Hello"
--[\B]
+[-\B]
';
$expected = '[\]
[\A]
@=-
--[\C]
+[-\C]
[\A\B]
';
"Key\"Containing\"Quotes"=-
"ValueContainingEscapes"=-
--[\A]
+[-\A]
';
$expected = '[\]