summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-11-02 15:13:01 +0100
committersalad <fmoenne-@student.le-101.fr>2020-11-02 15:13:01 +0100
commit5e920c8c12a6f49691bbbe50984030621b5b4cbe (patch)
tree4690e8b0437c75e155a1397c9637fe55e005940b
parentCaps files (diff)
download42-minishell-5e920c8c12a6f49691bbbe50984030621b5b4cbe.tar.gz
42-minishell-5e920c8c12a6f49691bbbe50984030621b5b4cbe.tar.bz2
42-minishell-5e920c8c12a6f49691bbbe50984030621b5b4cbe.tar.xz
42-minishell-5e920c8c12a6f49691bbbe50984030621b5b4cbe.tar.zst
42-minishell-5e920c8c12a6f49691bbbe50984030621b5b4cbe.zip
omw to sed-town
-rw-r--r--Makefile4
-rw-r--r--src/m_loop.c4
-rw-r--r--src/m_loop_counter.c12
3 files changed, 8 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 1f559be..6841aed 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,10 @@ SRCS_NAME += b_sqb_nbr
SRCS_NAME += b_sqb_str
SRCS_NAME += b_type
SRCS_NAME += b_unset
+SRCS_NAME += c_init
+SRCS_NAME += c_input
+SRCS_NAME += c_keys
+SRCS_NAME += c_utils
SRCS_NAME += e_builtins
SRCS_NAME += e_externs
SRCS_NAME += e_line
diff --git a/src/m_loop.c b/src/m_loop.c
index 27ebecd..181f384 100644
--- a/src/m_loop.c
+++ b/src/m_loop.c
@@ -137,9 +137,7 @@ unsigned char m_loop(int fd, t_msh *msh)
msh->curr_hist_ptr = hist;
while (gnl > 0)
{
- if (fd == STDIN_FILENO)
- m_prompt_psx(1, msh);
- gnl = get_next_line(fd, &line);
+ gnl = c_gnl(fd, &line, 1, msh);
m_delete_comments(line);
if (line[0] != C_NUL)
{
diff --git a/src/m_loop_counter.c b/src/m_loop_counter.c
index 330d3f1..85609dd 100644
--- a/src/m_loop_counter.c
+++ b/src/m_loop_counter.c
@@ -23,9 +23,7 @@ char *m_counter_line_backslash(int fd,
{
char *counter_line;
- if (fd == STDIN_FILENO)
- m_prompt_psx(psx, msh);
- get_next_line(fd, &counter_line);
+ c_gnl(fd, &line, psx, msh);
if (counter_line[0] != C_NUL)
{
l = ft_nrealloc(l,
@@ -43,9 +41,7 @@ char *m_counter_line_pipes(int fd, unsigned char psx, char *line, t_msh *msh)
{
char *counter_line;
- if (fd == STDIN_FILENO)
- m_prompt_psx(psx, msh);
- get_next_line(fd, &counter_line);
+ c_gnl(fd, &line, psx, msh);
if (counter_line[0] != C_NUL)
{
line = ft_nrealloc(line,
@@ -66,9 +62,7 @@ char *m_counter_line_quotes(int fd,
{
char *counter_line;
- if (fd == STDIN_FILENO)
- m_prompt_psx(psx, msh);
- get_next_line(fd, &counter_line);
+ c_gnl(fd, &line, psx, msh);
if (counter_line[0] != C_NUL)
{
line = ft_nrealloc(line,