diff --git a/result.txt b/result.txt new file mode 100755 index 0000000..e69de29 diff --git a/yeeshell b/yeeshell index 7525816..5eea9ac 100755 Binary files a/yeeshell and b/yeeshell differ diff --git a/yeeshell.c b/yeeshell.c index 84fcc2b..1123ea9 100644 --- a/yeeshell.c +++ b/yeeshell.c @@ -227,6 +227,10 @@ int execute(char *cmdline, char **args) free(redirect_args); exit(0); } + if ((redirect_flag == 1) || (redirect_flag == 2)) + { + close(fd); + } } else { @@ -251,7 +255,6 @@ int execute(char *cmdline, char **args) } } } - close(fd); return 1; }