"extern char **environ" in header file
+ global var g_all deleted, renamed switch_heredoc_sigint
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
|
||||
/* Updated: 2021/11/26 21:02:20 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/11/26 21:54:42 by lperrey ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -85,7 +85,7 @@ static t_list *ret_parameter_expansion(char *content, int *i)
|
||||
if (content[*i] == '?')
|
||||
{
|
||||
(*i)++;
|
||||
expand->content = ft_itoa(g_all->last_exit_status);
|
||||
expand->content = ft_itoa(get_last_exit_status());
|
||||
return (ft_retp_free(expand, tmp, free));
|
||||
}
|
||||
else if (content[*i] != '_' && !ft_isalpha(content[*i]))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/11/11 18:46:43 by lperrey #+# #+# */
|
||||
/* Updated: 2021/11/26 20:00:25 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/11/26 21:45:17 by lperrey ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -83,7 +83,7 @@ static int here_doc_write(char *delimiter, int doc_fd)
|
||||
ft_bzero(&signal_action, sizeof(signal_action));
|
||||
signal_action.sa_handler = sigint_handler_heredoc;
|
||||
sigaction(SIGINT, &signal_action, NULL);
|
||||
switch_heredoc_sigint = 0;
|
||||
g_switch_heredoc_sigint = 0;
|
||||
rl_event_hook = void_func_return_readline;
|
||||
//rl_signal_event_hook = void_func_return_readline;
|
||||
line_count = 0;
|
||||
@@ -92,7 +92,7 @@ static int here_doc_write(char *delimiter, int doc_fd)
|
||||
line_count++;
|
||||
line = NULL;
|
||||
line = readline("> ");
|
||||
if (switch_heredoc_sigint == 1)
|
||||
if (g_switch_heredoc_sigint == 1)
|
||||
return (set_last_exit_status(128 + SIGINT)); // TODO Macro for error
|
||||
if (!line)
|
||||
{ // TODO : error print wrapper
|
||||
|
||||
Reference in New Issue
Block a user