file perm error
This commit is contained in:
@@ -12,20 +12,25 @@
|
||||
|
||||
#include "../../includes/minishell.h"
|
||||
|
||||
static int execute_and(t_ast_n *node)
|
||||
{
|
||||
node->msh->ex_code = execute_command(node->left);
|
||||
if (node->msh->ex_code == 0)
|
||||
node->msh->ex_code = execute_command(node->right);
|
||||
return (node->msh->ex_code);
|
||||
}
|
||||
|
||||
int execute_command(t_ast_n *node)
|
||||
{
|
||||
if (!node || (node->state == _CMD && node->cmd == NULL))
|
||||
return (0);
|
||||
if (node->state == _CMD)
|
||||
handle_redir(node);
|
||||
if (handle_redir(node))
|
||||
return (1);
|
||||
if (node->state == _CMD)
|
||||
node->msh->ex_code = exec_scmd(node);
|
||||
else if (node->state == _AND)
|
||||
{
|
||||
node->msh->ex_code = execute_command(node->left);
|
||||
if (node->msh->ex_code == 0)
|
||||
node->msh->ex_code = execute_command(node->right);
|
||||
}
|
||||
node->msh->ex_code = execute_and(node);
|
||||
else if (node->state == _OR)
|
||||
{
|
||||
node->msh->ex_code = execute_command(node->left);
|
||||
|
||||
Reference in New Issue
Block a user