diff options
Diffstat (limited to 'src/p_line.c')
-rw-r--r-- | src/p_line.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/p_line.c b/src/p_line.c index af1ba64..8b13424 100644 --- a/src/p_line.c +++ b/src/p_line.c @@ -37,11 +37,32 @@ static void } } +static t_bool + p_check_whitespaces_only(char line[]) +{ + char *ptr; + + ptr = line; + while (*ptr != '\0') + { + if (*ptr != ' ' && *ptr != '\t') + { + return (FALSE); + } + ptr++; + } + return (TRUE); +} + void 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) { f_alloc_and_destroy_msh(msh); |