From be62057694eac8737bf01903c30e6b711135df42 Mon Sep 17 00:00:00 2001 From: James Farrell Date: Tue, 3 May 2022 21:18:13 +0000 Subject: [PATCH] Fix incorrect pop at end of function. --- toys/pending/sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 750cec5cd..651181b9d 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -2784,7 +2784,7 @@ static int parse_line(char *line, struct sh_pipeline **ppl, // Back up to saved function() statement and create sh_function free(dlist_lpop(expect)); - pl = (void *)(*expect)->data; + pl = (void *)(*expect)->prev->data; funky = xmalloc(sizeof(struct sh_function)); funky->refcount = 1; funky->name = *pl->arg->v;