Blame SOURCES/0002-Win-Hivex-Regedit-Ignore-comments.patch

f2549c
From 003028c3c0d33e952430d3f4e1a987a777674eb3 Mon Sep 17 00:00:00 2001
f2549c
From: Vladimir Panteleev <git@thecybershadow.net>
f2549c
Date: Thu, 16 Jan 2020 12:11:21 +0000
f2549c
Subject: [PATCH 2/2] Win::Hivex::Regedit: Ignore comments
f2549c
f2549c
---
f2549c
 perl/lib/Win/Hivex/Regedit.pm | 6 +++---
f2549c
 1 file changed, 3 insertions(+), 3 deletions(-)
f2549c
f2549c
diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm
f2549c
index 2b17036..f0dbb50 100644
f2549c
--- a/perl/lib/Win/Hivex/Regedit.pm
f2549c
+++ b/perl/lib/Win/Hivex/Regedit.pm
f2549c
@@ -153,8 +153,8 @@ sub reg_import
f2549c
         #print STDERR "reg_import: parsing <<<$_>>>\n";
f2549c
 
f2549c
         if ($state eq "outer") {
f2549c
-            # Ignore blank lines, headers.
f2549c
-            next if /^\s*$/;
f2549c
+            # Ignore blank lines, headers, comments.
f2549c
+            next if /^\s*(;.*)?$/;
f2549c
 
f2549c
             # .* is needed before Windows Registry Editor Version.. in
f2549c
             # order to eat a possible Unicode BOM which regedit writes
f2549c
@@ -193,7 +193,7 @@ sub reg_import
f2549c
                 my $value = _parse_value ("", $1, $encoding);
f2549c
                 croak (_parse_error ($_, $lineno)) unless defined $value;
f2549c
                 push @newvalues, $value;
f2549c
-            } elsif (/^\s*$/) { # blank line after values
f2549c
+            } elsif (/^\s*(;.*)?$/) { # blank line after values
f2549c
                 _merge_node ($hmap, \%params, $newnode, \@newvalues, \@delvalues);
f2549c
                 $state = "outer";
f2549c
             } else {
f2549c
-- 
f2549c
2.24.1
f2549c