From 591244c4f1874f536ca6fd7a3ad244e17f08385e Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Wed, 26 Oct 2022 23:05:20 -0500 Subject: [PATCH] Also avoid further processing after other errors in directive files --- gatekeeper.pl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 9e54469..7d840d8 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -1694,10 +1694,12 @@ sub interpret_directive { my $val = $1; # so far so good # Only let them specify one filename directive. - push @errors, - "Only one filename directive is allowed per directive file. " - ."Error at filename directive: $val." - if defined $header{filename}; + if (defined $header{filename}) { + push @errors, + "Only one filename directive is allowed per directive file. " + ."Error at filename directive: $val."; + next; + } $header{filename} = $val; $info{"filename"} = {"value" => $val, "order" => $cnt++}; # ok. @@ -1735,9 +1737,11 @@ sub interpret_directive { next; } - push @errors, - "invalid directive 'replace', not supported prior to version 1.2" - if $header{version} eq '1.1'; + if ($header{version} eq '1.1') { + push @errors, + "invalid directive 'replace', not supported prior to version 1.2"; + next; + } $options{replace} = ($1 eq 'true'); $info{"replace"} = $1; #ok. -- 2.25.1