mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 19:36:50 +01:00
「🔨」 fix: if only space error
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/20 20:25:06 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/15 18:05:05 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/16 14:20:19 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -29,5 +29,6 @@
|
||||
|
||||
char *get_program_name(char *argv_one);
|
||||
bool send_error_parsing(char *msg);
|
||||
bool check_space(char *rl);
|
||||
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/20 09:19:39 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/13 14:02:22 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/16 13:53:57 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -79,6 +79,7 @@ void __forked(char *delimiter, int fd, t_cmd *cmd)
|
||||
ft_envclear(get_env(NULL), free);
|
||||
ft_lstclear_till_nxt(get_list2(NULL), &free_cmd);
|
||||
ft_lstclear(get_list(NULL), &free_token);
|
||||
free(*get_rl(NULL));
|
||||
rl_clear_history();
|
||||
close(fd);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/15 17:03:47 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/16 14:20:42 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -42,6 +42,8 @@ bool run_checks(char *rl)
|
||||
return (true);
|
||||
if (check_pipe(rl))
|
||||
return (true);
|
||||
if (check_space(rl))
|
||||
return (true);
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/30 12:52:22 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/03 16:17:02 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/16 14:24:14 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -42,3 +42,13 @@ bool check_pipe(char *readline)
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool check_space(char *rl)
|
||||
{
|
||||
while (*rl && *rl == ' ')
|
||||
rl++;
|
||||
if (!*rl)
|
||||
return (send_error_parsing(ERROR_NO_FILE));
|
||||
else
|
||||
return (false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user