This commit is contained in:
kinou-p 2022-04-20 04:58:01 +02:00
parent 892d8f5b1e
commit 495a9cf884
4 changed files with 10 additions and 26 deletions

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* init_builtin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sadjigui <sadjigui@student.42.fr> +#+ +:+ +#+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/28 17:17:01 by sadjigui #+# #+# */
/* Updated: 2022/04/20 00:31:45 by sadjigui ### ########.fr */
/* Updated: 2022/04/20 04:56:50 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
@ -32,7 +32,6 @@ void ft_shlvl(char **env)
free (env[index]);
env[index] = ft_strjoin("SHLVL=", str);
free (str);
printf("%s\n", env[index]);
}
}
@ -45,7 +44,7 @@ void register_env(t_s_cmd *cmd, char *variable)
tmp = NULL;
tmp = (char **)malloc(sizeof(char *) * (tab_len(cmd->big_cmd->env) + 2));
if (!tmp)
printf("no tmp\n");
return ;
while (cmd->big_cmd->env[i])
{
tmp[i] = ft_strdup(cmd->big_cmd->env[i]);

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* unset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sadjigui <sadjigui@student.42.fr> +#+ +:+ +#+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/11 18:26:29 by sadjigui #+# #+# */
/* Updated: 2022/04/20 00:31:56 by sadjigui ### ########.fr */
/* Updated: 2022/04/20 04:56:12 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,7 +22,7 @@ void unset_variable(t_s_cmd *cmd, int i)
b = 0;
tmp = malloc(sizeof(char *) * tab_len(cmd->big_cmd->env));
if (!tmp)
printf("no tmp\n");
return ;
while (cmd->big_cmd->env[a])
{
if (a != i)

View File

@ -6,27 +6,12 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/06 13:27:11 by apommier #+# #+# */
/* Updated: 2022/04/20 04:45:06 by apommier ### ########.fr */
/* Updated: 2022/04/20 04:53:03 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/minishell.h"
// void crtl_c(int num)
// {
// num = 0;
// printf("\n");
// rl_replace_line("", 0);
// rl_on_new_line();
// rl_redisplay();
// }
// void sig_quit(int num)
// {
// (void)num;
// ft_putstr_fd("\b \b\b \b", 1);
// }
char **ft_dup_double(char **env)
{
char **new_tab;

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/19 19:25:16 by apommier #+# #+# */
/* Updated: 2022/04/19 19:36:02 by apommier ### ########.fr */
/* Updated: 2022/04/20 04:55:14 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,7 +23,7 @@ void sig_heredoc(int num)
ft_putchar_fd('\n', 1);
if (sigaction(SIGINT, &base, 0) == -1)
{
printf("sigaction error2\n");
printf("Minishell: sigaction error2\n");
return ;
}
}
@ -37,7 +37,7 @@ void change_signal(void)
test.sa_flags = 0;
if (sigaction(SIGINT, &test, 0) == -1)
{
printf("sigaction error\n");
printf("Minishell: sigaction error\n");
exit(1);
}
}