From f2e3a002967da5077a2c6f38e97025c12f4b0986 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 10 Sep 2020 17:30:53 +0200 Subject: Quick update --- TODO.org | 1 + src/s_com.c | 8 ++++---- 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); -- cgit v1.2.3