From 59cfad2031b5e9c86206e4a1562a84d2b549bf69 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 8 Nov 2019 20:20:17 +0000 Subject: edit: propagate correct editor exit code exit($?) is never correct, since ($? >> 8) is needed to extract the correct exit code, as other information (e.g. such as signal) is encoded in $? in addition to the exit code. --- script/public-inbox-edit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/public-inbox-edit b/script/public-inbox-edit index f2090abf..24b7ed8b 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -149,7 +149,11 @@ retry_edit: chomp(my $op = || ''); $op = lc($op); goto retry_edit if $op eq 'r'; - exit $? if $op eq 'q'; + if ($op eq 'q') { + # n.b. we'll lose the exit signal, here, + # oh well; "q" is user-specified anyways. + exit($? >> 8); + } last if $op eq 'c'; # continuing print STDERR "\`$op' not recognized\n"; } -- cgit v1.2.3-24-ge0c7