`-s $fh' returns undef only when a file is non-existent and zero
when it's empty. Thus so we must use `||' to skip empty files.
Furthermore, `-s FILEHANDLE' is never undef on open handles.
Fixes: 5aab49f3 (lei: support reading MH for convert+import+index, 2023-12-29)
my $f = "$d/$x/$n";
open my $fh, '<', $f or next;
# some (buggy) Maildir writers are non-atomic:
my $f = "$d/$x/$n";
open my $fh, '<', $f or next;
# some (buggy) Maildir writers are non-atomic:
- my $raw = read_all($fh, -s $fh // next);
+ my $raw = read_all($fh, -s $fh || next);
next if $vrfy && blob_mismatch $f, $oidhex, \$raw;
return \$raw;
}
next if $vrfy && blob_mismatch $f, $oidhex, \$raw;
return \$raw;
}
$f =~ s/\Amh://s or die "BUG: not MH: $f";
$f .= "/$n";
open my $fh, '<', $f or next;
$f =~ s/\Amh://s or die "BUG: not MH: $f";
$f .= "/$n";
open my $fh, '<', $f or next;
- my $raw = read_all($fh, -s $fh // next);
+ my $raw = read_all($fh, -s $fh || next);
next if blob_mismatch $f, $oidhex, \$raw;
return \$raw;
}
next if blob_mismatch $f, $oidhex, \$raw;
return \$raw;
}