The builtin function returns the raw status, which is not the same as the
integer return by waitpid. Therefore, the WIF macros shouldn't be used for
checking or obtaining the status.

This bug can be seen by executing (eval false). The builtin eval function
returns 1, but proc_format_status misinterprets it as a signal by checking
WIFSIGNALED, so adds 128 to the status to return 129.
---
 exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/exec.c b/exec.c
index 13fb81b..2f5f8e6 100644
--- a/exec.c
+++ b/exec.c
@@ -1575,7 +1575,7 @@ void exec( job_t *j )
                                        {
                                                debug( 3, L"Set status of %ls 
to %d using short circut", j->command, p->status );
 
-                                               int status = 
proc_format_status(p->status);
+                                               int status = p->status;
                                                proc_set_last_status( 
job_get_flag( j, JOB_NEGATE )?(!status):status );
                                        }
                                        break;
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to