diff options
Diffstat (limited to 'src/main.c')
| -rwxr-xr-x | src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |
