mrc0mmand / rpms / hivex

Forked from rpms/hivex 3 years ago
Clone

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

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