From 07e2901a4da7d6c88a7ff34521ffd224394cbe8f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 4 May 2026 13:26:56 -0500 Subject: [PATCH] Fix alias thinko and move unredirect(&pp->urd) into free_process() --- toys/pending/sh.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 73a543c3..09319d60 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -1419,6 +1419,7 @@ static struct sh_process *free_process(struct sh_process *pp) next = pp->next; if (!--pp->refcount) { llist_traverse(pp->delete, llist_free_arg); + unredirect(&pp->urd); free(pp); } @@ -1447,10 +1448,7 @@ static void end_fcall(void) while (pop_block()); free(ff->blk); free_function(ff->function); - if (ff->pp) { - unredirect(&ff->pp->urd); - free_process(ff->pp); - } + free_process(ff->pp); // Unblock signal we just finished handling if (TT.ff->signal) { @@ -4579,22 +4577,24 @@ void alias_main(void) char *s; int i, j; + // print all aliases if (!toys.optc || FLAG(p)) for (i = 0; i