diff options
Diffstat (limited to 'src/p_line.c')
-rw-r--r-- | src/p_line.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/p_line.c b/src/p_line.c index 6e02525..af1ba64 100644 --- a/src/p_line.c +++ b/src/p_line.c @@ -20,10 +20,28 @@ #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++; + } +} + void p_line(char line[], t_msh *msh) { + p_delete_comments(line); if (p_lcom(line, msh) < 0) { f_alloc_and_destroy_msh(msh); |