From fd6ffbd6b8e616a9cbb777a420ecf08aae56d7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 6 May 2021 23:09:40 +0200 Subject: Fix static file copying stat may return undef --- gen.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gen.pl b/gen.pl index d1d5d5f..6a0ec7c 100755 --- a/gen.pl +++ b/gen.pl @@ -91,7 +91,8 @@ opendir $out, 'out' or die "Could not open directory src: $!"; my %src = map { ($_, (stat "src/$_")[9]||0) } grep { not /^\./ or /^index\.html$/ } readdir $src; my %out = map { ($_, (stat "out/$_")[9]||0) } grep { not /^\./ or /^index\.html$/ } readdir $out; for (keys %src) { - if ($out{$_} and $src{$_} > $out{$_}) { + no warnings 'uninitialized'; + if ($src{$_} > $out{$_}) { print STDERR "COPY: src/$_ => out/$_\n" if $opt{d}; copy "src/$_" => "out/$_"; } -- cgit v1.2.3