summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-09 16:45:07 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-09 16:45:07 +0200
commitddf4006f9db4920c47efdd8488203408cf8d5e58 (patch)
treefac9b016fa7e67b1a0e38e7e609f0550da51005d
parentIn progress (diff)
download42-minishell-ddf4006f9db4920c47efdd8488203408cf8d5e58.tar.gz
42-minishell-ddf4006f9db4920c47efdd8488203408cf8d5e58.tar.bz2
42-minishell-ddf4006f9db4920c47efdd8488203408cf8d5e58.tar.xz
42-minishell-ddf4006f9db4920c47efdd8488203408cf8d5e58.tar.zst
42-minishell-ddf4006f9db4920c47efdd8488203408cf8d5e58.zip
qwe
-rw-r--r--src/p_split.c14
-rw-r--r--src/s_struct.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/p_split.c b/src/p_split.c
index 25f1cc7..482bc58 100644
--- a/src/p_split.c
+++ b/src/p_split.c
@@ -211,6 +211,15 @@ static t_split
return (sp);
}
+static char
+**p_get_words(const char line[], const t_split sp)
+{
+ char **words;
+
+ words = NULL;
+ return (words);
+}
+
char
**p_split_line(char line[])
{
@@ -219,6 +228,11 @@ char
words = NULL;
sp = p_fill_sp(line);
+ if ((words = p_get_words(line, sp)) == NULL)
+ {
+ ft_memdel((void*)&line);
+ return (NULL);
+ }
ft_memdel((void*)&line);
return (words);
}
diff --git a/src/s_struct.h b/src/s_struct.h
index f7ea271..2734618 100644
--- a/src/s_struct.h
+++ b/src/s_struct.h
@@ -14,6 +14,7 @@
#define S_STRUCT_H
#include <stdint.h>
+#include <limits.h>
#include "d_define.h"
@@ -59,7 +60,7 @@ struct s_lpipes
typedef struct s_line_block
{
- char lblock[4096];
+ char lblock[ARG_MAX];
uint8_t nextif;
struct s_line_block *next;
} t_line_block;