diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-09-30 18:34:32 +0200 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-09-30 18:34:32 +0200 |
commit | afa9544b6c00285dd2f77bb1e852d8f0e95d42b6 (patch) | |
tree | 96f6194e4667540525911cba051a01001918ee0b /src/c_utils.c | |
parent | gnl grand remplacment (diff) | |
download | 42-minishell-afa9544b6c00285dd2f77bb1e852d8f0e95d42b6.tar.gz 42-minishell-afa9544b6c00285dd2f77bb1e852d8f0e95d42b6.tar.bz2 42-minishell-afa9544b6c00285dd2f77bb1e852d8f0e95d42b6.tar.xz 42-minishell-afa9544b6c00285dd2f77bb1e852d8f0e95d42b6.tar.zst 42-minishell-afa9544b6c00285dd2f77bb1e852d8f0e95d42b6.zip |
call a plumber
Diffstat (limited to '')
-rw-r--r-- | src/c_utils.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/c_utils.c b/src/c_utils.c index 8bc940e..78b923a 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -30,25 +30,26 @@ ** C-c globul pid */ -int16_t - c_new_line(char *line, - t_msh *msh, - t_caps *tcaps) +char + *c_new_line(char *line, + t_caps *tcaps, + t_msh *msh) { + char *ret; + + (void)msh; + ret = NULL; write(1, "\n", 1); tputs(tgetstr("cr", NULL), 1, ft_putchar); c_set_term_raw(0); if (line != NULL) { - m_parse_and_run_line(line, msh); - line = NULL; - free(line); + ret = ft_strdup(line); + line[0] = '\0'; } tcaps->cpos = 0; tputs(tgetstr("cr", NULL), 1, ft_putchar); - c_set_term_raw(1); - m_prompt_psx(1, msh); - return (1); + return (ret); } char |