Also avoid further processing after other errors in directive files
authorJacob Bachmeyer <jcb@gnu.org>
Thu, 27 Oct 2022 04:05:20 +0000 (23:05 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Thu, 27 Oct 2022 04:05:20 +0000 (23:05 -0500)
gatekeeper.pl

index 9e54469ebe2d2fcadc9f8c8847775816897d844b..7d840d8328598e3070ca7980de73b8c4e1d78326 100755 (executable)
@@ -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.