diff options
Diffstat (limited to 'src/lsh_builtins.c')
| -rw-r--r-- | src/lsh_builtins.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lsh_builtins.c b/src/lsh_builtins.c index 81fc2b5..0986cfe 100644 --- a/src/lsh_builtins.c +++ b/src/lsh_builtins.c @@ -2,6 +2,7 @@ #define shell_builtins #include "lsh_main_func.c" +#include "helper_functions.c" #include <stdio.h> #include <string.h> #include <unistd.h> @@ -48,11 +49,7 @@ int lsh_cd(char **args) if (err != 0) { perror("lsh"); } - char *cwd=(char*)malloc(sizeof(char)*4096); - if (!cwd) { - fprintf(stderr, "lsh: allocation error\n"); - exit(EXIT_FAILURE); - } + char *cwd=(char*)malloce(sizeof(char)*4096); getcwd(cwd,sizeof(char*)*4096); setenv("PWD",cwd,1); free(cwd); |
