diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-02-27 19:53:33 -0600 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-02-27 19:53:33 -0600 |
| commit | 1eb83090ac4b5a31b352a843c85304df9af1f3e0 (patch) | |
| tree | 5b78d7f1a7b8281f34c980630e5b9fbdf84833ce /src/lsh_builtins.c | |
| parent | 022a202e31157859bc0fac25479a4782514e50a9 (diff) | |
- changed make
- malloc with error function
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); |
