fix: "echo $" works

This commit is contained in:
Camille Chauvet
2023-03-22 14:59:19 +01:00
parent 72ff3ba134
commit b3d060874d
8 changed files with 19 additions and 14 deletions

View File

@ -54,10 +54,10 @@ char *ft_get_executable_without_path(t_data *data, const char *name)
if (path == NULL)
{
ft_eprintf("minishell: malloc failed\n");
break;
break ;
}
if (access(path, X_OK) == 0)
break;
break ;
free(path);
path = NULL;
i++;
@ -74,7 +74,7 @@ char *ft_get_executable_without_path(t_data *data, const char *name)
char *ft_get_executable(t_data *data, const char *name)
{
char *path;
if (name[0] == '.' || name[0] == '/')
path = ft_get_executable_with_path(data, name);
else

View File

@ -29,8 +29,7 @@ void ft_strshift(char *str, int shift);
char *ft_quote_remover(char *str);
int ft_atoi_check(const char *nptr);
char *ft_get_executable(t_data *data, const char *name);
void ft_closer(int fds[2]);
void ft_add_fd(int fds[2], int fd);
void ft_closer(int fds[2]);
void ft_add_fd(int fds[2], int fd);
#endif