1From 7243037e63bff34b08bb1c993787b98dee585b2f Mon Sep 17 00:00:00 2001 2From: Li Zhou <li.zhou@windriver.com> 3Date: Thu, 27 Jun 2019 13:10:47 +0800 4Subject: [PATCH] dc: fix exit code of q command 5 6The exit code for "echo q | dc" is 1 for dc-1.4.1; 7while the exit code for "echo q | dc" is 0 for dc-1.4. 8 9Here is the answer from ken@gnu.org: 10dc-1.4 was right. There was a rewrite of a chunk of code for 1.4.1 to 11fix a corner case in the Q command, and somehow the placement of the 12clean-up label for the 'q' command got misplaced on the error-handling 13branch instead of the clean-exit branch. The patch below fixes this 14(it is committed for whenever the next bc/dc release gets made). 15 16Thanks for the report, 17 --Ken Pizzini 18 19Upstream: 20https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-extended/bc/bc/0001-dc-fix-exit-code-of-q-command.patch 21 22Signed-off-by: Li Zhou <li.zhou@windriver.com> 23Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> 24--- 25 dc/eval.c | 2 +- 26 1 file changed, 1 insertion(+), 1 deletion(-) 27 28diff --git a/dc/eval.c b/dc/eval.c 29index 6c54e61..9c28f18 100644 30--- a/dc/eval.c 31+++ b/dc/eval.c 32@@ -841,10 +841,10 @@ error_fail: 33 fprintf(stderr, "%s: ", progname); 34 perror("error reading input"); 35 return DC_FAIL; 36-reset_and_exit_quit: 37 reset_and_exit_fail: 38 signal(SIGINT, sigint_default); 39 return DC_FAIL; 40+reset_and_exit_quit: 41 reset_and_exit_success: 42 signal(SIGINT, sigint_default); 43 return DC_SUCCESS; 44-- 452.17.1 46 47