update: fixed error on pipe+redirection
This commit is contained in:
parent
1dfb7f7ef7
commit
baa9af918f
9 changed files with 34 additions and 37 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:31:28 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/10/10 18:54:14 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/10/11 22:16:18 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -56,7 +56,6 @@ t_error _run_other(t_ast_node self, t_state *state, int *out)
|
|||
*out = subshell_res.exit;
|
||||
}
|
||||
state->last_exit = *out;
|
||||
printf("state->last_exit = %i\n", state->last_exit);
|
||||
return (NO_ERROR);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:30:09 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/09/18 21:51:46 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/10/11 22:19:06 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ put_string_fd(lstate.output_fd, "^C\n"), line_refresh_line(&lstate), ERROR);
|
|||
}
|
||||
}
|
||||
line_edit_stop(&lstate);
|
||||
if (line == NULL || str_compare(delim, line))
|
||||
if (line == NULL || (str_compare(delim, line) && (str_free(line), 1)))
|
||||
break ;
|
||||
(put_string_fd(write, line), put_char_fd(write, '\n'), str_free(line));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:24:49 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/10/10 18:56:40 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/10/11 22:16:01 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -117,7 +117,6 @@ t_error _handle_builtin(t_spawn_info info, t_state *state, t_cmd_pipe cmd_pipe,
|
|||
return (ERROR);
|
||||
if (_setup_binfo(&info, &binfo, out))
|
||||
return (ERROR);
|
||||
printf("last_exit = %i\n", state->last_exit);
|
||||
_run_builtin(&binfo, actual_func, cmd_pipe, out);
|
||||
if (binfo.stdin)
|
||||
close_fd(binfo.stdin);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:38:38 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/10/10 18:58:52 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/10/11 22:16:10 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -54,7 +54,6 @@ t_error _run_expansion_special_var(t_ast_expansion *self, t_state *state,
|
|||
if (name == '?')
|
||||
{
|
||||
*out = (t_expansion_result){.exists = true, .value = NULL};
|
||||
printf("state->last_exit in exp = %i \n", state->last_exit);
|
||||
if (i32_to_str(state->last_exit, &out->value)) // TODO: fix this shit
|
||||
return (ERROR);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue