From f7af740cf2bccde2e6edbac31a0182fafe05d25e Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Tue, 3 Mar 2026 00:17:36 -0600 Subject: pipes --- src/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index ef42a50..9dbf65c 100755 --- a/src/main.c +++ b/src/main.c @@ -26,8 +26,7 @@ void lsh_loop(SHELL_OB *shell_obj){ int j=0; while (cmds[j]){ args = lsh_split_line(cmds[j]->cmd); - status = lsh_execute(args); - free(cmds[j]); + status = lsh_execute(args,cmds[j]); j++; int i=0; @@ -36,6 +35,11 @@ void lsh_loop(SHELL_OB *shell_obj){ free(args); } + int i=0; + while(cmds[i]){ + free(cmds[i]); + i++; + } free(cmds); free(line); } while (status); -- cgit v1.3