bye bye DG
This commit is contained in:
parent
03edcfc777
commit
b9e5321b5b
13 changed files with 17 additions and 43 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/13 13:09:57 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/18 00:53:53 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:14:20 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -41,10 +41,7 @@ t_execf *is_builtin(t_process *p)
|
|||
while (g_builtin[++i].name)
|
||||
{
|
||||
if (ft_strcmp(g_builtin[i].name, p->data.cmd.av[0]) == 0)
|
||||
{
|
||||
DG();
|
||||
return (g_builtin[i].f);
|
||||
}
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/10/15 13:27:14 by alao #+# #+# */
|
||||
/* Updated: 2017/03/20 14:41:04 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:14:35 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -63,7 +63,6 @@ int c_matching(t_data *s, t_comp *c)
|
|||
char *current_word;
|
||||
|
||||
current_word = c_current_words(c);
|
||||
DG("current_word = %s", current_word);
|
||||
if (ft_strchr(c->rcmd, '/'))
|
||||
c_seek_abs_path(c, current_word);
|
||||
else if (ft_strchr(c->rcmd, '$'))
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 19:02:23 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/20 15:50:14 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:15:17 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,7 +16,6 @@ int plaunch_case(t_process *p)
|
|||
{
|
||||
t_exec *exec;
|
||||
|
||||
DG("exec case");
|
||||
exec = &data_singleton()->exec;
|
||||
exec->attrs &= ~EXEC_CASE_BRANCH;
|
||||
exec->case_pattern = token_to_argv(p->data.d_case.token, 1);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/08 03:23:59 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/20 15:50:21 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:15:21 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
int plaunch_function(t_process *p)
|
||||
{
|
||||
DG("do function");
|
||||
ft_exec(&p->data.function.content);
|
||||
return (ft_atoi(ft_getenv(data_singleton()->env, "?")));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_dgreat.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/06 22:07:37 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/05 18:10:36 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:15:39 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -20,10 +20,7 @@ int redirect_dgreat(t_redir *redir)
|
|||
fdnew = redir->n;
|
||||
if ((fdold = open(redir->word,
|
||||
O_WRONLY | O_CREAT | O_APPEND, 0644)) < 0)
|
||||
{
|
||||
DG("open errno=%i", errno);
|
||||
exit(1);
|
||||
}
|
||||
dup2(fdold, fdnew);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* redirect_great.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/06 22:03:53 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/20 12:38:41 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:15:43 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -20,10 +20,7 @@ int redirect_great(t_redir *redir)
|
|||
fdnew = redir->n;
|
||||
if ((fdold = open(redir->word,
|
||||
O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0)
|
||||
{
|
||||
DG("open errno=%i", errno);
|
||||
exit(1);
|
||||
}
|
||||
dup2(fdold, fdnew);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* set_exitstatus.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/28 14:25:17 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/20 15:35:33 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:15:50 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -26,11 +26,8 @@ void set_exitstatus(int status, int override)
|
|||
else if (WIFSIGNALED(status))
|
||||
exitval = 128 + WTERMSIG(status);
|
||||
else
|
||||
{
|
||||
DG("%s: process was not exited nor signaled.", SHELL_NAME);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
astatus = ft_itoa(exitval);
|
||||
builtin_setenv("setenv", (char*[]){"setenv", "?", astatus, 0}, NULL);
|
||||
ft_strdel(&astatus);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/14 19:44:25 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/20 15:10:40 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:16:20 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -63,7 +63,6 @@ static void execute_command(char *const av[], char **env)
|
|||
data->opts &= ~SH_INTERACTIVE;
|
||||
data->opts &= ~SH_OPTS_JOBC;
|
||||
command = manage_command(av);
|
||||
DG("command is %s", command);
|
||||
if (do_lexer_routine(&token, command))
|
||||
{
|
||||
ft_dprintf(2, "{red}%s: syntax error in command substitution{eoc}\n",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/17 11:37:47 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/16 12:10:14 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:16:45 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -18,7 +18,6 @@ void free_history_list(t_list_history *head)
|
|||
|
||||
if (!head)
|
||||
return ;
|
||||
DG("free hist");
|
||||
if (head->next)
|
||||
free(head->next);
|
||||
while (head)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/20 14:46:44 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:12:18 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -65,10 +65,8 @@ int main(int ac, char **av)
|
|||
|
||||
g_argv = av;
|
||||
setlocale(LC_ALL, "");
|
||||
DG("{inv}{bol}{gre}start of shell{eoc}");
|
||||
if (shell_init(ac, av) != 0)
|
||||
return (1);
|
||||
DG("JOBC is %s", SH_HAS_JOBC(data_singleton()->opts) ? "ON" : "OFF");
|
||||
token = NULL;
|
||||
ast = NULL;
|
||||
data = data_singleton();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/20 14:54:28 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:12:27 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -100,22 +100,17 @@ int shell_init(int ac, char **av)
|
|||
t_data *data;
|
||||
|
||||
data = data_singleton();
|
||||
DG();
|
||||
if (data_init(ac, av) < 0)
|
||||
return (-1);
|
||||
DG();
|
||||
if (cliopts_get(av, g_opts, data))
|
||||
{
|
||||
usage();
|
||||
return (ft_perror());
|
||||
}
|
||||
DG();
|
||||
if (!isatty(STDIN) || *data->av_data)
|
||||
data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC);
|
||||
DG();
|
||||
if ((data->fd = get_input_fd(data)) < 0)
|
||||
return (-1);
|
||||
DG();
|
||||
if (SH_IS_INTERACTIVE(data->opts) && interactive_settings() < 0)
|
||||
return (-1);
|
||||
return (0);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/10 14:57:45 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/13 20:36:01 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:11:11 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -55,7 +55,6 @@ int add_bang(t_btree **ast, t_list **lst)
|
|||
t_astnode *node;
|
||||
t_token *token;
|
||||
|
||||
DG("add bang");
|
||||
token = (*lst)->content;
|
||||
node = (*ast)->item;
|
||||
if ((token->type == TK_CASE || token->type == TK_WHILE
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* add_if.c :+: :+: :+: */
|
||||
/* add_condition.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/10 17:06:16 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/13 20:46:40 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/20 18:11:18 by gwojda ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -88,7 +88,6 @@ int add_if(t_btree **ast, t_list **lst)
|
|||
t_token *token;
|
||||
t_astnode *node;
|
||||
|
||||
DG("add if");
|
||||
token = (*lst)->content;
|
||||
node = (*ast)->item;
|
||||
node->type = TK_IF;
|
||||
|
|
|
|||
Loading…
Reference in a new issue