summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoe <rbousset@42lyon.fr>2020-12-04 18:23:58 +0100
committerjoe <rbousset@42lyon.fr>2020-12-04 18:23:58 +0100
commit9c54925787fe0a788e4014baf202c2ffc37cb4f4 (patch)
tree94ad68ecf4c3ad5ab73fa9c0f7fb818b0974ccfa /src
parentGood now (diff)
download42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.gz
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.bz2
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.xz
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.tar.zst
42-minishell-9c54925787fe0a788e4014baf202c2ffc37cb4f4.zip
fix
Diffstat (limited to 'src')
-rw-r--r--src/c_init.c1
-rw-r--r--src/m_loop_counter.c15
2 files changed, 6 insertions, 10 deletions
diff --git a/src/c_init.c b/src/c_init.c
index f707c69..5ba6a67 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -156,7 +156,6 @@ char *c_set_ptr(t_bool reset, char key, t_msh *msh)
if (p - context != 0 && *p != C_NUL)
p += 1;
}
- /* ft_printf("\n\r[%s]\n\r[%s]\n\r", context, p); */
return (p);
}
diff --git a/src/m_loop_counter.c b/src/m_loop_counter.c
index d1d4dcf..936fa7c 100644
--- a/src/m_loop_counter.c
+++ b/src/m_loop_counter.c
@@ -28,15 +28,12 @@ char *m_counter_line_backslash(int fd,
c_gnl(fd, &counter_line, psx, msh);
else
get_next_line(fd, &counter_line);
- if (counter_line[0] != C_NUL)
- {
- l = ft_nrealloc(l,
- ft_strlen(l) + 1,
- ft_strlen(l) + ft_strlen(counter_line));
- ft_memcpy(l + ft_strlen(l) - 1,
- counter_line,
- ft_strlen(counter_line) + 1);
- }
+ l = ft_nrealloc(l,
+ ft_strlen(l) + 1,
+ ft_strlen(l) + ft_strlen(counter_line));
+ ft_memcpy(l + ft_strlen(l) - 1,
+ counter_line,
+ ft_strlen(counter_line) + 1);
ft_memdel((void*)&counter_line);
return (l);
}