From 1eb83090ac4b5a31b352a843c85304df9af1f3e0 Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Fri, 27 Feb 2026 19:53:33 -0600 Subject: - changed make - malloc with error function --- src/lsh_builtins.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lsh_builtins.c') 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 #include #include @@ -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); -- cgit v1.3