This commit is contained in:
Etienne Rey-bethbeder
2023-04-14 16:17:35 +02:00
parent 882a39fc94
commit 0b56e95868
12 changed files with 36 additions and 36 deletions

View File

@ -20,7 +20,7 @@ int ft_change_exit_code(t_data *data, int new_value)
exit_code_str = ft_itoa(new_value);
if (exit_code_str == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
return (1);
}
return (0);

View File

@ -20,19 +20,19 @@ char *ft_get_executable_with_path(t_data *data, const char *name)
if (access(name, F_OK) != 0)
{
*data->exit_code = 127;
ft_eprintf("minishell: %s: No such file or directery\n", name);
ft_eprintf("bozoshell: %s: No such file or directery\n", name);
return (NULL);
}
if (access(name, X_OK) != 0)
{
*data->exit_code = 126;
ft_eprintf("minishell: %s: permission denied\n", name);
ft_eprintf("bozoshell: %s: permission denied\n", name);
return (NULL);
}
path = ft_strdup(name);
if (path == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
return (NULL);
}
return (path);
@ -47,13 +47,13 @@ static char **ft_get_paths(t_data *data, const char *name)
if (paths == NULL)
{
*data->exit_code = 127;
ft_eprintf("minishell: %s: command not found\n", name);
ft_eprintf("bozoshell: %s: command not found\n", name);
return (NULL);
}
tab = ft_split(paths, ':');
if (tab == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
return (NULL);
}
return (tab);
@ -66,7 +66,7 @@ static char *ft_file_is_executable(const char *path, const char *name)
out = ft_strmerger(3, path, "/", name);
if (out == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
free(out);
return (NULL);
}
@ -98,7 +98,7 @@ static char *ft_get_executable_without_path(t_data *data, const char *name)
if (path == NULL)
{
*data->exit_code = 127;
ft_eprintf("minishell: %s: command not found\n", name);
ft_eprintf("bozoshell: %s: command not found\n", name);
}
return (path);
}