From 3efb0bf5cf7b799b8df039e4fa3dd593248dc415 Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 30 Jan 2006 08:04:14 +1000 Subject: [PATCH] Fix bug that caused shellscript functions in pipelines that don't have any output to never be properly removed darcs-hash:20060129220414-ac50b-8c26e83933a73ef146c28bed020a6a2dfeca425f.gz --- exec.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 0c4d5ac83..b7bd10066 100644 --- a/exec.c +++ b/exec.c @@ -1016,7 +1016,7 @@ void exec( job_t *j ) if( !io_buffer ) { /* - No buffer, se we exit directly. This means we + No buffer, so we exit directly. This means we have to manually set the exit status. */ if( p->next == 0 ) @@ -1068,6 +1068,15 @@ void exec( job_t *j ) } } + else + { + if( p->next == 0 ) + { + proc_set_last_status( j->negate?(status?0:1):status); + } + p->completed = 1; + } + io_buffer_destroy( io_buffer );