about summary refs log tree commit homepage
path: root/script/public-inbox-edit
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-27 02:53:05 +0000
committerEric Wong <e@80x24.org>2020-12-28 23:19:48 +0000
commit522bb4a4973d4ac41b83be58dd3257e8cd038744 (patch)
tree4ff707e12c1520ac6c8b80249bde1be4ee76250e /script/public-inbox-edit
parent0f545dd95ca88e69f011aa56d07494887e7df822 (diff)
downloadpublic-inbox-522bb4a4973d4ac41b83be58dd3257e8cd038744.tar.gz
Reading from regular files (even on STDIN) can fail
when dealing with flakey storage.
Diffstat (limited to 'script/public-inbox-edit')
-rwxr-xr-xscript/public-inbox-edit3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index a70614fc..81f023bc 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -183,7 +183,8 @@ retry_edit:
         # rename/relink $edit_fn
         open my $new_fh, '<', $edit_fn or
                 die "can't read edited file ($edit_fn): $!\n";
-        my $new_raw = do { local $/; <$new_fh> };
+        defined(my $new_raw = do { local $/; <$new_fh> }) or die
+                "read $edit_fn: $!\n";
 
         if (!$opt->{raw}) {
                 # get rid of the From we added