9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2009-09-17 11:11:51 +02:00
parent 84688dfdb4
commit 4596d2b6f9
1 changed files with 6 additions and 1 deletions

View File

@ -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);