cf: check for undefined variables
The w32-hh-toc-from-info.pl script would fail with more recent versions of Perl, as it attempted to access undefined variables.
This commit is contained in:
@@ -56,7 +56,9 @@ my $tree = HTML::TreeBuilder->new();
|
||||
$tree->parse_file($input_file);
|
||||
|
||||
my $contents = $tree->look_down('class', 'contents');
|
||||
my $clist = $contents->find_by_tag_name('ul');
|
||||
if (defined($contents)) {
|
||||
my $clist = $contents->find_by_tag_name('ul');
|
||||
}
|
||||
|
||||
print TOC '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
@@ -79,6 +81,8 @@ sub process_ul_element
|
||||
my $e = shift;
|
||||
my $level = shift;
|
||||
|
||||
return unless defined($e);
|
||||
|
||||
if ($e->tag() eq "ul") {
|
||||
|
||||
print TOC ' 'x$level;
|
||||
|
Reference in New Issue
Block a user