summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-10 17:30:53 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-10 17:30:53 +0200
commitf2e3a002967da5077a2c6f38e97025c12f4b0986 (patch)
treeb43bdfa4557244258b13e1cf2b8471ee06c72427
parentEven better parse (diff)
download42-minishell-f2e3a002967da5077a2c6f38e97025c12f4b0986.tar.gz
42-minishell-f2e3a002967da5077a2c6f38e97025c12f4b0986.tar.bz2
42-minishell-f2e3a002967da5077a2c6f38e97025c12f4b0986.tar.xz
42-minishell-f2e3a002967da5077a2c6f38e97025c12f4b0986.tar.zst
42-minishell-f2e3a002967da5077a2c6f38e97025c12f4b0986.zip
Quick update
-rw-r--r--TODO.org1
-rw-r--r--src/s_com.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/TODO.org b/TODO.org
index 556105e..945cae0 100644
--- a/TODO.org
+++ b/TODO.org
@@ -12,6 +12,7 @@
** TODO [#A] Fix PSX \stuff subst with "" ''
** DONE [#A] ls qweqwe; echo $? <---- substitute
** TODO [#A] <>>
+** TODO [#A] SEGV on pipes
** DONE [#B] forked write(2) stuff on cd
** DONE [#B] Multiline && ||
** DONE [#B] ./qwe.sh <=== handle bad shebang
diff --git a/src/s_com.c b/src/s_com.c
index 0f206c4..dc81046 100644
--- a/src/s_com.c
+++ b/src/s_com.c
@@ -28,7 +28,7 @@ static int8_t
uint64_t j;
i = 0;
- if (words[0])
+ if (words[0] != NULL)
{
if (((*com)->bin = (char*)malloc((ft_strlen(words[0]) + 1) *
sizeof(char))) == NULL)
@@ -59,7 +59,7 @@ static int8_t
}
static void
- com_cpy_env_fork(t_com **com,
+ s_com_cpy_env_fork(t_com **com,
t_msh *msh)
{
size_t i;
@@ -118,11 +118,11 @@ t_com
return (NULL);
if ((words = p_split_args(word, com->redir)) == NULL)
return (NULL);
- words = p_check_args_equals(words, msh);
if ((words = p_subst_home(words, msh)) == NULL)
return (NULL);
+ words = p_check_args_equals(words, msh);
if (msh->env_fork_tmp[0][0] != '\0')
- com_cpy_env_fork(&com, msh);
+ s_com_cpy_env_fork(&com, msh);
if (fill_com(words, &com) < 0)
{
ft_delwords(words);