Closed biralavor closed 2 months ago
Modify hardcode of len (strncmp) to ft_strlen(cmd->lexeme):
void builtins_manager(t_token_list *lst) { static bool arg_option; t_token_list *cmd; cmd = lst; arg_option = false; while (cmd) { if (ft_strncmp(cmd->lexeme, "echo", 4) == 0) builtins_runner_echo(cmd, arg_option); else if (ft_strncmp(cmd->lexeme, "cd", 2) == 0) builtins_runner_cd(cmd); else if (ft_strncmp(cmd->lexeme, "pwd", 3) == 0) builtins_runner_pwd(cmd); else if (ft_strncmp(cmd->lexeme, "exit", 4) == 0) { exit_status_holder(0); break ; } if (NULL == cmd) break ; cmd = cmd->next; } }
Modify hardcode of len (strncmp) to ft_strlen(cmd->lexeme):