chiark / gitweb /
refactor filter_subdir_mk, breaking out $pi, nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 15:14:55 +0000 (15:14 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 15:14:55 +0000 (15:14 +0000)
subdirmk/generate

index 3208c8d..56bfe54 100755 (executable)
@@ -195,11 +195,16 @@ sub filter_subdir_mk ($$$$$) {
     #print STDERR "filter @_\n";
 
     my $esclit = '&';
-    for my $f ("${srcdir}/${dir_prefix}Subdir.mk.in",
-              "${srcdir}/Perdir.mk.in") {
+
+    my $pi = sub {
+       my ($f, $enoentok) = @_;
        process_input_mk($dir_prefix, $dir_suffix, $dir_name,
                         $var_prefix, $targets,
-                        $f, \$esclit, 0);
+                        $f, \$esclit, $enoentok);
+    };
+    for my $f ("${srcdir}/${dir_prefix}Subdir.mk.in",
+              "${srcdir}/Perdir.mk.in") {
+       $pi->($f, 0);
     }
 }