summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-12-15 16:35:22 +0100
committersalad <fmoenne-@student.le-101.fr>2020-12-15 16:35:22 +0100
commit2f2a2cf1d163762b9f10e0886fc1399f1bc896fa (patch)
treec980e3add583785126f70ee3d8a098188ab5024a
parentnoleak ???????????????? (diff)
download42-minishell-2f2a2cf1d163762b9f10e0886fc1399f1bc896fa.tar.gz
42-minishell-2f2a2cf1d163762b9f10e0886fc1399f1bc896fa.tar.bz2
42-minishell-2f2a2cf1d163762b9f10e0886fc1399f1bc896fa.tar.xz
42-minishell-2f2a2cf1d163762b9f10e0886fc1399f1bc896fa.tar.zst
42-minishell-2f2a2cf1d163762b9f10e0886fc1399f1bc896fa.zip
start refactoring shit
-rw-r--r--src/c_init.c2
-rw-r--r--src/c_utils.c8
-rw-r--r--src/c_utils.h2
3 files changed, 3 insertions, 9 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 7fb530f..434f456 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -222,7 +222,7 @@ static char
return (c_ctrl_c(line, buf, msh));
else
c_read_cap(buf, *line, tcaps, msh);
- return ((buf[0] == '\n') ? c_new_line(*line, tcaps) : NULL);
+ return ((buf[0] == '\n') ? c_new_line(tcaps) : NULL);
}
short
diff --git a/src/c_utils.c b/src/c_utils.c
index f5e66fe..a7769bb 100644
--- a/src/c_utils.c
+++ b/src/c_utils.c
@@ -22,7 +22,7 @@
#include "s_struct.h"
char
- *c_new_line(char *line, t_caps *tcaps)
+ *c_new_line(t_caps *tcaps)
{
char *ret;
size_t i;
@@ -32,12 +32,6 @@ char
write(1, "\n", 1);
tputs(tgetstr("cr", NULL), 1, ft_putchar);
c_set_term_raw(0);
- (void)line;
- /* if (line != NULL) */
- /* { */
- /* ret = ft_strdup(line); */
- /* *line = '\0'; */
- /* } */
tcaps->cpos = 0;
tputs(tgetstr("cr", NULL), 1, ft_putchar);
if (i < tcaps->nlines && tcaps->nlines != 1)
diff --git a/src/c_utils.h b/src/c_utils.h
index aad51ea..4cafa3b 100644
--- a/src/c_utils.h
+++ b/src/c_utils.h
@@ -15,7 +15,7 @@
# include "s_struct.h"
-char *c_new_line(char *line, t_caps *tcaps);
+char *c_new_line(t_caps *tcaps);
char *c_insert_char(char *str, char c, t_caps *tcaps);
char *c_delchar(char *str, unsigned short cpos);
short c_redraw_line(char *line, t_caps *tcaps);