From 56ccad6b85a5f3f17eebaf4ba511e07ba760b050 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 15 Aug 2020 18:00:23 +0200 Subject: Can read scripts, but need to handle fails --- src/p_line.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/p_line.c') 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); -- cgit v1.2.3