diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-08-29 19:47:08 +0200 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-08-29 19:47:08 +0200 |
commit | 670e296bee4082214c8ae4e956bdcc41e1260234 (patch) | |
tree | e45711246afd752330a6b1d1360dad1b2f6e0106 /src/e_externs_pipes.c | |
parent | testing for nothing (diff) | |
download | 42-minishell-670e296bee4082214c8ae4e956bdcc41e1260234.tar.gz 42-minishell-670e296bee4082214c8ae4e956bdcc41e1260234.tar.bz2 42-minishell-670e296bee4082214c8ae4e956bdcc41e1260234.tar.xz 42-minishell-670e296bee4082214c8ae4e956bdcc41e1260234.tar.zst 42-minishell-670e296bee4082214c8ae4e956bdcc41e1260234.zip |
no more SEGV on e_externs_pipes if prog member is nonsense
Diffstat (limited to 'src/e_externs_pipes.c')
-rw-r--r-- | src/e_externs_pipes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/e_externs_pipes.c b/src/e_externs_pipes.c index 858e60f..8556cbb 100644 --- a/src/e_externs_pipes.c +++ b/src/e_externs_pipes.c @@ -174,6 +174,9 @@ void rptr = rptr->next; } i = 0; - exec_path((const char**)fullpath, head, msh); + while (fullpath[i] != NULL) + i++; + if (i == (pipes + 1)) + exec_path((const char**)fullpath, head, msh); ft_delwords(fullpath); } |