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

@ -126,13 +126,13 @@ bool ft_check_redirection(t_data *data, t_cmd *cmd,
if (ft_is_in("<>", redirection_identifier[0])
&& ft_is_in("<>", redirection[0]))
{
ft_eprintf("minishell: %s: invalid redirection file\n", redirection);
ft_eprintf("bozoshell: %s: invalid redirection file\n", redirection);
return (1);
}
str = ft_strdup(redirection);
if (str == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
return (1);
}
ft_quote_remover(str);

View File

@ -21,14 +21,14 @@ int ft_file_is_readable(t_data *data, const char *path)
if (fd == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: No such file or directory\n", path);
ft_eprintf("bozoshell: %s: No such file or directory\n", path);
return (0);
}
readable = read(fd, "", 0);
if (readable == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: Permission denied\n", path);
ft_eprintf("bozoshell: %s: Permission denied\n", path);
return (0);
}
close(fd);
@ -44,14 +44,14 @@ int ft_file_is_writable(t_data *data, const char *path)
if (fd == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: Permission denied\n", path);
ft_eprintf("bozoshell: %s: Permission denied\n", path);
return (0);
}
writeable = write(fd, "", 0);
if (writeable == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: Permission denied\n", path);
ft_eprintf("bozoshell: %s: Permission denied\n", path);
return (0);
}
close(fd);
@ -67,14 +67,14 @@ int ft_file_is_appendable(t_data *data, const char *path)
if (fd == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: Permission denied\n", path);
ft_eprintf("bozoshell: %s: Permission denied\n", path);
return (0);
}
writeable = write(fd, "", 0);
if (writeable == -1)
{
*data->exit_code = 1;
ft_eprintf("minishell: %s: Permission denied\n", path);
ft_eprintf("bozoshell: %s: Permission denied\n", path);
return (0);
}
close(fd);

View File

@ -41,7 +41,7 @@ static int ft_heredoc3(char *stop, int fds[2])
}
else
{
ft_eprintf("minishell: warning: here-document at line");
ft_eprintf("bozoshell: warning: here-document at line");
ft_eprintf("1 delimited by end-of-file (wanted `%s')\n", stop);
return (2);
}

View File

@ -84,7 +84,7 @@ int ft_set_redirection(t_data *data, t_cmd *cmd, char **tab)
}
if (ft_is_in("<>", tab[i][0]))
{
ft_eprintf("minishell: %s: must be followed by a file\n", tab[i]);
ft_eprintf("bozoshell: %s: must be followed by a file\n", tab[i]);
return (1);
}
return (0);
@ -101,7 +101,7 @@ int ft_redirection(t_data *data, t_cmd *cmd, char *cmd_str)
tab = ft_split_charset_quoted(cmd_str, " \t");
if (tab == NULL)
{
ft_eprintf("minishell: malloc failed\n");
ft_eprintf("bozoshell: malloc failed\n");
return (1);
}
ft_remove_redirection(cmd_str);