diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-22 18:49:41 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-22 18:49:41 +0200 |
commit | ca88bc609950ebe3f84b4a5cadeb069fc3aded14 (patch) | |
tree | 38a9791a5acd7554bcceaaae86e0b9403b119d7d /src/p_redirs.c | |
parent | In progress (diff) | |
download | 42-minishell-ca88bc609950ebe3f84b4a5cadeb069fc3aded14.tar.gz 42-minishell-ca88bc609950ebe3f84b4a5cadeb069fc3aded14.tar.bz2 42-minishell-ca88bc609950ebe3f84b4a5cadeb069fc3aded14.tar.xz 42-minishell-ca88bc609950ebe3f84b4a5cadeb069fc3aded14.tar.zst 42-minishell-ca88bc609950ebe3f84b4a5cadeb069fc3aded14.zip |
Unfinished
Diffstat (limited to 'src/p_redirs.c')
-rw-r--r-- | src/p_redirs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/p_redirs.c b/src/p_redirs.c index 6297255..108a2a3 100644 --- a/src/p_redirs.c +++ b/src/p_redirs.c @@ -44,6 +44,7 @@ static void p_append_redir(const char path[], new = s_lredir_new(path, fd, redir); if (new == NULL) { + /* TODO: return (1) and abort command right here */ return ; } new->heredoc = NULL; @@ -64,7 +65,7 @@ static size_t p_get_path(char path[], size_t len; hlen = 0; - tmp.ptr += ft_abs(tmp.redir); + tmp.ptr += (tmp.redir == 3) ? (2) : (ft_abs(tmp.redir)); while (*tmp.ptr != C_NUL && ft_iswhitespace(*tmp.ptr) == TRUE) tmp.ptr++; if (*tmp.ptr == C_TILDE && u_get_var_value(h, "$HOME", PATH_MAX, msh) == 0) |