Skip to content

Commit

Permalink
Merge pull request #698 from galacticusorg/fixEmptyDirectiveLineParse
Browse files Browse the repository at this point in the history
Ignore empty lines when parsing directives
  • Loading branch information
abensonca authored Sep 11, 2024
2 parents bcc0a68 + 7d6df1c commit f682b8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion perl/Galacticus/Build/Directives.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sub Extract_Directive {
$xmlText .= $line;
$depth += () = ( $line =~ /<([a-zA-Z0-9]+)[^\/>]*>/g ); # Increment depth by count of any opening elements.
$depth -= () = ( $line =~ /<\/([a-zA-Z0-9]+)>/g ); # Decrement depth by count of any closing elements.
if ( defined($xmlText) && $depth == 0 ) {
if ( defined($xmlText) && $xmlText !~ m/^\s*$/ && $depth == 0 ) {
# Parse the XML.
my $xml = new XML::Simple(KeepRoot => 1);
$directive = eval{$xml->XMLin($xmlText)};
Expand Down

0 comments on commit f682b8d

Please sign in to comment.