fixes
This commit is contained in:
12
srcs/main.c
12
srcs/main.c
@@ -31,6 +31,16 @@ static void add_prevhistory(t_msh *msh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void exit_manual(t_msh *msh)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = msh->ex_code;
|
||||||
|
free_msh(msh);
|
||||||
|
ft_fprintf(2, "exit\n");
|
||||||
|
exit(ret);
|
||||||
|
}
|
||||||
|
|
||||||
int interactive_mode(t_msh *msh)
|
int interactive_mode(t_msh *msh)
|
||||||
{
|
{
|
||||||
msh->input = malloc(1);
|
msh->input = malloc(1);
|
||||||
@@ -40,7 +50,7 @@ int interactive_mode(t_msh *msh)
|
|||||||
free(msh->input);
|
free(msh->input);
|
||||||
msh->input = powerline(msh);
|
msh->input = powerline(msh);
|
||||||
if (!msh->input)
|
if (!msh->input)
|
||||||
return (0);
|
exit_manual(msh);
|
||||||
}
|
}
|
||||||
if (!msh->input)
|
if (!msh->input)
|
||||||
return (1);
|
return (1);
|
||||||
|
|||||||
@@ -130,6 +130,6 @@ t_node *tokenize(char *str)
|
|||||||
del_void_nodes(&head);
|
del_void_nodes(&head);
|
||||||
debug_token_list(head, "tokenizer");
|
debug_token_list(head, "tokenizer");
|
||||||
if (syntax_error(head))
|
if (syntax_error(head))
|
||||||
return (NULL);
|
return (free_linked_list(head), NULL);
|
||||||
return (head);
|
return (head);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user