Merge branch 'master' of https://github.com/jzck/42sh
This commit is contained in:
commit
eb4af04a36
5 changed files with 16 additions and 16 deletions
|
|
@ -123,7 +123,7 @@ void c_printer(t_comp *c)
|
|||
t_clst *ptr;
|
||||
int loop;
|
||||
int max_line;
|
||||
int offset;
|
||||
//int offset;
|
||||
|
||||
loop = c->c_line;
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ void c_printer(t_comp *c)
|
|||
max_line = (c->c_line % (c->m_size - 1));
|
||||
else
|
||||
max_line = c->m_size - 1;
|
||||
offset = (c->m_size - 1) - max_line;
|
||||
// offset = (c->m_size - 1) - max_line;
|
||||
while (loop && max_line)
|
||||
{
|
||||
c_printer_line(c, ptr, c->c_pline, 1);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ int process_redirect(t_process *p)
|
|||
{
|
||||
redir = redirs->content;
|
||||
DG("redirs content : %p", redirs->content);
|
||||
DG("redir.type [%i]", redir->type);
|
||||
// DG("redir.type [%li]", redir->type);
|
||||
DG("redir.word [%s]", redir->word);
|
||||
DG("redir.n [%i]", redir->n);
|
||||
if (redir->n > 9)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ int dir_research(t_glob *gl, char *p,
|
|||
ft_ld_pushfront(&gl->match_tmp, ft_strjoin(p + gl->cur_dir * 2 *
|
||||
(p[0] == '.' && p[1] == '/'), "/"));
|
||||
else
|
||||
ft_ld_pushfront(&gl->match_tmp, ft_strdup(""));
|
||||
ft_ld_pushfront(&gl->match_tmp, ft_strdup(CH(gl->m_pat)[0]));
|
||||
return (0);
|
||||
}
|
||||
if ((ft_strlen(p) <= 1 || p[ft_strlen(p) - 1] != '.') && is_directory(p))
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
int iscondition(t_btree **ast, t_list **lst)
|
||||
{
|
||||
t_astnode *node;
|
||||
t_token *token;
|
||||
// t_token *token;
|
||||
|
||||
node = NULL;
|
||||
token = (*lst)->content;
|
||||
// token = (*lst)->content;
|
||||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
|
||||
#include "minishell.h"
|
||||
|
||||
static int isdir_sep_condition(t_btree **ast, t_list **lst)
|
||||
static int isdir_sep_condition(t_btree **ast)//, t_list **lst)
|
||||
{
|
||||
t_token *token;
|
||||
// t_token *token;
|
||||
t_astnode *node;
|
||||
|
||||
token = (*lst)->content;
|
||||
// token = (*lst)->content;
|
||||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
|
|
@ -27,12 +27,12 @@ static int isdir_sep_condition(t_btree **ast, t_list **lst)
|
|||
return (0);
|
||||
}
|
||||
|
||||
static int isdir_word_condition(t_btree **ast, t_list **lst)
|
||||
static int isdir_word_condition(t_btree **ast)//, t_list **lst)
|
||||
{
|
||||
t_token *token;
|
||||
// t_token *token;
|
||||
t_astnode *node;
|
||||
|
||||
token = (*lst)->content;
|
||||
// token = (*lst)->content;
|
||||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
|
|
@ -45,19 +45,19 @@ static int isdir_word_condition(t_btree **ast, t_list **lst)
|
|||
int isdir_condition(t_btree **ast, t_list **lst)
|
||||
{
|
||||
t_token *token;
|
||||
t_astnode *node;
|
||||
// t_astnode *node;
|
||||
|
||||
token = (*lst)->content;
|
||||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
// node = (*ast)->item;
|
||||
if ((token->type == TK_LESS || token->type == TK_GREAT
|
||||
|| token->type == TK_GREATAND || token->type == TK_LESSAND
|
||||
|| token->type == TK_DLESS || token->type == TK_DGREAT)
|
||||
&& isdir_sep_condition(&(*ast)->left, lst) == 1)
|
||||
&& isdir_sep_condition(&(*ast)->left) == 1)
|
||||
return (1);
|
||||
if (token->type == TK_WORD
|
||||
&& isdir_word_condition(&(*ast)->left, lst) == 1)
|
||||
&& isdir_word_condition(&(*ast)->left) == 1)
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue