]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-edit
edit: propagate correct editor exit code
[public-inbox.git] / script / public-inbox-edit
index f2090abfe583992ab6c398213438c3a76a3775d3..24b7ed8b2d220bb7a1bc090c7228e2a7fb608e21 100755 (executable)
@@ -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";
                }