about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-08 20:20:17 +0000
committerEric Wong <e@80x24.org>2019-11-08 20:20:59 +0000
commit59cfad2031b5e9c86206e4a1562a84d2b549bf69 (patch)
tree32d273583d6da83fa38bfa4bb48dea8613928cd3 /script
parent54eca8f1163fbba1ff297468becf8f62eb9a44a4 (diff)
downloadpublic-inbox-59cfad2031b5e9c86206e4a1562a84d2b549bf69.tar.gz
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.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-edit6
1 files changed, 5 insertions, 1 deletions
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 = <STDIN> || '');
                         $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";
                 }