diff --git a/include/error_msg.h b/include/error_msg.h index 6c3ab51..edf8302 100644 --- a/include/error_msg.h +++ b/include/error_msg.h @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 diff --git a/src/exec/heredoc.c b/src/exec/heredoc.c index 1903cc5..4f2d91a 100644 --- a/src/exec/heredoc.c +++ b/src/exec/heredoc.c @@ -6,7 +6,7 @@ /* By: mmoussou +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); +}