user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/2] edit: propagate correct editor exit code
  2019-11-08 20:20  5% [PATCH 0/2] edit: minor bug fixes Eric Wong
@ 2019-11-08 20:20  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-11-08 20:20 UTC (permalink / raw)
  To: meta

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(-)

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";
 		}

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] edit: minor bug fixes
@ 2019-11-08 20:20  5% Eric Wong
  2019-11-08 20:20  7% ` [PATCH 1/2] edit: propagate correct editor exit code Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-11-08 20:20 UTC (permalink / raw)
  To: meta

A few minor bugfixes I noticed while working on other stuff...

Eric Wong (2):
  edit: propagate correct editor exit code
  edit: check for write errors writing "From_" line

 script/public-inbox-edit | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-11-08 20:20  5% [PATCH 0/2] edit: minor bug fixes Eric Wong
2019-11-08 20:20  7% ` [PATCH 1/2] edit: propagate correct editor exit code Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).