diff options
Diffstat (limited to 'src/p_line.c')
-rw-r--r-- | src/p_line.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/p_line.c b/src/p_line.c index 8b13424..c8381c8 100644 --- a/src/p_line.c +++ b/src/p_line.c @@ -16,26 +16,10 @@ #include "d_enum.h" #include "f_fail.h" #include "p_line.h" -#include "p_lcom.h" +#include "p_lblock.h" #include "s_destroy.h" #include "s_struct.h" - -static void - p_delete_comments(char line[]) -{ - char *ptr; - - ptr = line; - while (*ptr != '\0') - { - if (*ptr == '#') - { - *ptr = '\0'; - return ; - } - ptr++; - } -} +#include "u_utils.h" static t_bool p_check_whitespaces_only(char line[]) @@ -45,7 +29,7 @@ static t_bool ptr = line; while (*ptr != '\0') { - if (*ptr != ' ' && *ptr != '\t') + if (ft_iswhitespace(*ptr) == FALSE) { return (FALSE); } @@ -55,15 +39,13 @@ static t_bool } void - p_line(char line[], - t_msh *msh) + p_line(char line[], t_msh *msh) { - p_delete_comments(line); if (p_check_whitespaces_only(line) == TRUE) { return ; } - if (p_lcom(line, msh) < 0) + if (p_line_block(line, msh) < 0) { f_alloc_and_destroy_msh(msh); } |