summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-12 15:57:51 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-12 15:57:51 +0200
commit81900e8ff106bbd9602f6589fc54e4530f5cc3dd (patch)
treeb71cb48ffdc971ebb1299215aa19c19e66a0e6ab
parentAliases work, fucker (diff)
download42-minishell-81900e8ff106bbd9602f6589fc54e4530f5cc3dd.tar.gz
42-minishell-81900e8ff106bbd9602f6589fc54e4530f5cc3dd.tar.bz2
42-minishell-81900e8ff106bbd9602f6589fc54e4530f5cc3dd.tar.xz
42-minishell-81900e8ff106bbd9602f6589fc54e4530f5cc3dd.tar.zst
42-minishell-81900e8ff106bbd9602f6589fc54e4530f5cc3dd.zip
Fix
-rw-r--r--src/e_builtins.c1
-rw-r--r--src/m_argv.c7
-rw-r--r--src/p_lblock_next.c4
-rw-r--r--src/s_init.c3
4 files changed, 6 insertions, 9 deletions
diff --git a/src/e_builtins.c b/src/e_builtins.c
index 7c86a5f..90e436e 100644
--- a/src/e_builtins.c
+++ b/src/e_builtins.c
@@ -53,6 +53,7 @@ static void
dup_redirs(ptr, msh);
ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh);
u_eof_fd(msh->fd);
+ s_com_destroy(&msh->com);
s_line_clear(&msh->curr);
s_destroy(msh);
exit(ret);
diff --git a/src/m_argv.c b/src/m_argv.c
index 5b2bc96..98a8e3e 100644
--- a/src/m_argv.c
+++ b/src/m_argv.c
@@ -24,8 +24,7 @@
#include "s_struct.h"
static void
- m_read_script(char *const argv[],
- t_msh *msh)
+ m_read_script(char *const argv[], t_msh *msh)
{
int32_t fd;
@@ -36,9 +35,7 @@ static void
}
uint8_t
- m_argv(int argc,
- char *const argv[],
- t_msh *msh)
+ m_argv(int argc, char *const argv[], t_msh *msh)
{
if (argc == 1)
{
diff --git a/src/p_lblock_next.c b/src/p_lblock_next.c
index 707acc0..3fa0ea5 100644
--- a/src/p_lblock_next.c
+++ b/src/p_lblock_next.c
@@ -62,9 +62,9 @@ static void
ft_strlcpy(tmp, ptr + i, varlen + 1 - i);
u_get_var_value(varval, tmp, ARG_MAX, msh);
p_double_them_bs(varval);
- (void)ft_memmove(ptr + (i + ft_strlen(tmp)),
+ ft_strlcpy(ptr + (i + ft_strlen(varval)),
ptr + varlen,
- (ft_strlen(ptr + varlen) + 1) * sizeof(char));
+ ft_strlen(ptr + varlen) + 1);
(void)ft_memmove(word + i, varval, ft_strlen(varval) * sizeof(char));
*(p) = word + (i + ft_strlen(varval) - 1);
}
diff --git a/src/s_init.c b/src/s_init.c
index fb63548..b229cda 100644
--- a/src/s_init.c
+++ b/src/s_init.c
@@ -157,8 +157,7 @@ static void
}
t_msh
- *init_msh(char *const argv[],
- char *const envp[])
+ *init_msh(char *const argv[], char *const envp[])
{
char cwd[PATH_MAX];
t_msh *msh;