This commit is contained in:
Jack Halford 2017-03-13 00:03:58 +01:00
commit eb4af04a36
5 changed files with 16 additions and 16 deletions

View file

@ -123,7 +123,7 @@ void c_printer(t_comp *c)
t_clst *ptr; t_clst *ptr;
int loop; int loop;
int max_line; int max_line;
int offset; //int offset;
loop = c->c_line; loop = c->c_line;
@ -133,7 +133,7 @@ void c_printer(t_comp *c)
max_line = (c->c_line % (c->m_size - 1)); max_line = (c->c_line % (c->m_size - 1));
else else
max_line = c->m_size - 1; max_line = c->m_size - 1;
offset = (c->m_size - 1) - max_line; // offset = (c->m_size - 1) - max_line;
while (loop && max_line) while (loop && max_line)
{ {
c_printer_line(c, ptr, c->c_pline, 1); c_printer_line(c, ptr, c->c_pline, 1);

View file

@ -34,7 +34,7 @@ int process_redirect(t_process *p)
{ {
redir = redirs->content; redir = redirs->content;
DG("redirs content : %p", 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.word [%s]", redir->word);
DG("redir.n [%i]", redir->n); DG("redir.n [%i]", redir->n);
if (redir->n > 9) if (redir->n > 9)

View file

@ -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 * ft_ld_pushfront(&gl->match_tmp, ft_strjoin(p + gl->cur_dir * 2 *
(p[0] == '.' && p[1] == '/'), "/")); (p[0] == '.' && p[1] == '/'), "/"));
else else
ft_ld_pushfront(&gl->match_tmp, ft_strdup("")); ft_ld_pushfront(&gl->match_tmp, ft_strdup(CH(gl->m_pat)[0]));
return (0); return (0);
} }
if ((ft_strlen(p) <= 1 || p[ft_strlen(p) - 1] != '.') && is_directory(p)) if ((ft_strlen(p) <= 1 || p[ft_strlen(p) - 1] != '.') && is_directory(p))

View file

@ -15,10 +15,10 @@
int iscondition(t_btree **ast, t_list **lst) int iscondition(t_btree **ast, t_list **lst)
{ {
t_astnode *node; t_astnode *node;
t_token *token; // t_token *token;
node = NULL; node = NULL;
token = (*lst)->content; // token = (*lst)->content;
if (*ast) if (*ast)
{ {
node = (*ast)->item; node = (*ast)->item;

View file

@ -12,12 +12,12 @@
#include "minishell.h" #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; t_astnode *node;
token = (*lst)->content; // token = (*lst)->content;
if (*ast) if (*ast)
{ {
node = (*ast)->item; node = (*ast)->item;
@ -27,12 +27,12 @@ static int isdir_sep_condition(t_btree **ast, t_list **lst)
return (0); 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; t_astnode *node;
token = (*lst)->content; // token = (*lst)->content;
if (*ast) if (*ast)
{ {
node = (*ast)->item; 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) int isdir_condition(t_btree **ast, t_list **lst)
{ {
t_token *token; t_token *token;
t_astnode *node; // t_astnode *node;
token = (*lst)->content; token = (*lst)->content;
if (*ast) if (*ast)
{ {
node = (*ast)->item; // node = (*ast)->item;
if ((token->type == TK_LESS || token->type == TK_GREAT if ((token->type == TK_LESS || token->type == TK_GREAT
|| token->type == TK_GREATAND || token->type == TK_LESSAND || token->type == TK_GREATAND || token->type == TK_LESSAND
|| token->type == TK_DLESS || token->type == TK_DGREAT) || token->type == TK_DLESS || token->type == TK_DGREAT)
&& isdir_sep_condition(&(*ast)->left, lst) == 1) && isdir_sep_condition(&(*ast)->left) == 1)
return (1); return (1);
if (token->type == TK_WORD if (token->type == TK_WORD
&& isdir_word_condition(&(*ast)->left, lst) == 1) && isdir_word_condition(&(*ast)->left) == 1)
return (1); return (1);
} }
return (0); return (0);