X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=script%2Fpublic-inbox-edit;h=1c6c4e4a08e24fa32484a893487e39826830f359;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=a70614fc2a4074e1c35485a2a290ddefe7ab0249;hpb=6accd690b16aa0bce7117286944d69f378611eb8;p=public-inbox.git diff --git a/script/public-inbox-edit b/script/public-inbox-edit index a70614fc..1c6c4e4a 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2020 all contributors +# Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ # # Used for editing messages in a public-inbox. @@ -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