| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [OSSTEST PATCH 22/60] history reporting: Skip undefined keys
 This makes it work if the caller's cached hash contains an key which
is bound to undef.
sg-report-host-history already does this, which currently causes:
 Use of uninitialized value $_ in substitution (s///) at 
Osstest/HistoryReport.pm line 134.
 Use of uninitialized value $_ in printf at Osstest/HistoryReport.pm line 135.
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/HistoryReport.pm | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index 61b1ee8f..cb8c6ca1 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -131,6 +131,7 @@ sub cache_write_entry ($$) {
        foreach my $k (sort keys %$h) {
            next if $k =~ m/^\%/;
            $_ = $h->{$k};
+           next unless defined;
            s{[^-+=/~:;_.,\w]}{ sprintf "%%%02x", ord $& }ge;
            printf $fh " %s=%s", $k, $_;
        }
-- 
2.11.0
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |