mrc0mmand / rpms / hivex

Forked from rpms/hivex 3 years ago
Clone
Blob Blame History Raw
From 003028c3c0d33e952430d3f4e1a987a777674eb3 Mon Sep 17 00:00:00 2001
From: Vladimir Panteleev <git@thecybershadow.net>
Date: Thu, 16 Jan 2020 12:11:21 +0000
Subject: [PATCH 2/2] Win::Hivex::Regedit: Ignore comments

---
 perl/lib/Win/Hivex/Regedit.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm
index 2b17036..f0dbb50 100644
--- a/perl/lib/Win/Hivex/Regedit.pm
+++ b/perl/lib/Win/Hivex/Regedit.pm
@@ -153,8 +153,8 @@ sub reg_import
         #print STDERR "reg_import: parsing <<<$_>>>\n";
 
         if ($state eq "outer") {
-            # Ignore blank lines, headers.
-            next if /^\s*$/;
+            # Ignore blank lines, headers, comments.
+            next if /^\s*(;.*)?$/;
 
             # .* is needed before Windows Registry Editor Version.. in
             # order to eat a possible Unicode BOM which regedit writes
@@ -193,7 +193,7 @@ sub reg_import
                 my $value = _parse_value ("", $1, $encoding);
                 croak (_parse_error ($_, $lineno)) unless defined $value;
                 push @newvalues, $value;
-            } elsif (/^\s*$/) { # blank line after values
+            } elsif (/^\s*(;.*)?$/) { # blank line after values
                 _merge_node ($hmap, \%params, $newnode, \@newvalues, \@delvalues);
                 $state = "outer";
             } else {
-- 
2.24.1