done ?
This commit is contained in:
parent
892d8f5b1e
commit
495a9cf884
@ -3,10 +3,10 @@
|
|||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* init_builtin.c :+: :+: :+: */
|
/* init_builtin.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: sadjigui <sadjigui@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/02/28 17:17:01 by sadjigui #+# #+# */
|
/* 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]);
|
free (env[index]);
|
||||||
env[index] = ft_strjoin("SHLVL=", str);
|
env[index] = ft_strjoin("SHLVL=", str);
|
||||||
free (str);
|
free (str);
|
||||||
printf("%s\n", env[index]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +44,7 @@ void register_env(t_s_cmd *cmd, char *variable)
|
|||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
tmp = (char **)malloc(sizeof(char *) * (tab_len(cmd->big_cmd->env) + 2));
|
tmp = (char **)malloc(sizeof(char *) * (tab_len(cmd->big_cmd->env) + 2));
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
printf("no tmp\n");
|
return ;
|
||||||
while (cmd->big_cmd->env[i])
|
while (cmd->big_cmd->env[i])
|
||||||
{
|
{
|
||||||
tmp[i] = ft_strdup(cmd->big_cmd->env[i]);
|
tmp[i] = ft_strdup(cmd->big_cmd->env[i]);
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* unset.c :+: :+: :+: */
|
/* unset.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: sadjigui <sadjigui@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/03/11 18:26:29 by sadjigui #+# #+# */
|
/* 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;
|
b = 0;
|
||||||
tmp = malloc(sizeof(char *) * tab_len(cmd->big_cmd->env));
|
tmp = malloc(sizeof(char *) * tab_len(cmd->big_cmd->env));
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
printf("no tmp\n");
|
return ;
|
||||||
while (cmd->big_cmd->env[a])
|
while (cmd->big_cmd->env[a])
|
||||||
{
|
{
|
||||||
if (a != i)
|
if (a != i)
|
||||||
|
|||||||
17
srcs/main.c
17
srcs/main.c
@ -6,27 +6,12 @@
|
|||||||
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/03/06 13:27:11 by apommier #+# #+# */
|
/* 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"
|
#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 **ft_dup_double(char **env)
|
||||||
{
|
{
|
||||||
char **new_tab;
|
char **new_tab;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/04/19 19:25:16 by apommier #+# #+# */
|
/* 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);
|
ft_putchar_fd('\n', 1);
|
||||||
if (sigaction(SIGINT, &base, 0) == -1)
|
if (sigaction(SIGINT, &base, 0) == -1)
|
||||||
{
|
{
|
||||||
printf("sigaction error2\n");
|
printf("Minishell: sigaction error2\n");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ void change_signal(void)
|
|||||||
test.sa_flags = 0;
|
test.sa_flags = 0;
|
||||||
if (sigaction(SIGINT, &test, 0) == -1)
|
if (sigaction(SIGINT, &test, 0) == -1)
|
||||||
{
|
{
|
||||||
printf("sigaction error\n");
|
printf("Minishell: sigaction error\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user