diff options
author | Eric Wong <e@80x24.org> | 2020-12-27 02:53:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-28 23:19:48 +0000 |
commit | 522bb4a4973d4ac41b83be58dd3257e8cd038744 (patch) | |
tree | 4ff707e12c1520ac6c8b80249bde1be4ee76250e /script/public-inbox-edit | |
parent | 0f545dd95ca88e69f011aa56d07494887e7df822 (diff) | |
download | public-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-x | script/public-inbox-edit | 3 |
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 |