summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-09-17 11:11:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-09-25 13:34:22 +0200
commit4596d2b6f951b505866db26d374d3282f93bcf16 (patch)
tree9226be9bf2299b685c1a0bcd1345948a1a260c8c /common
parent84688dfdb4aecc8296b4fef9bc657335d7b9ade5 (diff)
downloadbarebox-4596d2b6f951b505866db26d374d3282f93bcf16.tar.gz
barebox-4596d2b6f951b505866db26d374d3282f93bcf16.tar.xz
hush: Only run list if it's not empty
Running empty lists lead to the wrong return status Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/hush.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/hush.c b/common/hush.c
index db47e6569c..9c9725cf01 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1378,7 +1378,12 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
if (rcode != 1 && ctx->old_flag == 0) {
done_word(&temp, ctx);
done_pipe(ctx,PIPE_SEQ);
- code = run_list(ctx->list_head);
+ if (ctx->list_head->num_progs) {
+ code = run_list(ctx->list_head);
+ } else {
+ free_pipe_list(ctx->list_head, 0);
+ continue;
+ }
if (code == -2) { /* exit */
b_free(&temp);