summaryrefslogtreecommitdiffstats
path: root/src/p_line.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/p_line.c')
-rw-r--r--src/p_line.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/p_line.c b/src/p_line.c
index 9c96610..170d8a8 100644
--- a/src/p_line.c
+++ b/src/p_line.c
@@ -19,6 +19,7 @@
#include "p_lcom.h"
#include "s_destroy.h"
#include "s_struct.h"
+#include "u_utils.h"
static void
p_delete_comments(char line[])
@@ -30,8 +31,11 @@ static void
{
if (*ptr == '#')
{
- *ptr = '\0';
- return ;
+ if ((ptr - line) == 0 || ft_iswhitespace(*(ptr - 1)) == TRUE)
+ {
+ *ptr = '\0';
+ return ;
+ }
}
ptr++;
}