summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/p_line.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/p_line.c b/src/p_line.c
index 8b13424..ec148e3 100644
--- a/src/p_line.c
+++ b/src/p_line.c
@@ -37,6 +37,22 @@ static void
}
}
+static void
+ p_subst_spaces(char line[])
+{
+ char *ptr;
+
+ ptr = line;
+ while (*ptr != '\0')
+ {
+ if (ft_isspace(*ptr) == TRUE)
+ {
+ *ptr = ' ';
+ }
+ ptr++;
+ }
+}
+
static t_bool
p_check_whitespaces_only(char line[])
{
@@ -45,7 +61,7 @@ static t_bool
ptr = line;
while (*ptr != '\0')
{
- if (*ptr != ' ' && *ptr != '\t')
+ if (ft_isspace(*ptr) == FALSE)
{
return (FALSE);
}
@@ -59,6 +75,7 @@ void
t_msh *msh)
{
p_delete_comments(line);
+ p_subst_spaces(line);
if (p_check_whitespaces_only(line) == TRUE)
{
return ;