summaryrefslogtreecommitdiffstats
path: root/src/p_args.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/p_args.c')
-rw-r--r--src/p_args.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/src/p_args.c b/src/p_args.c
index 54a95a7..fc676a1 100644
--- a/src/p_args.c
+++ b/src/p_args.c
@@ -88,7 +88,7 @@ static uint16_t
}
static char
- **p_split_words_no_rdr(const char word[])
+ **p_split_words(const char word[])
{
char **words;
size_t start[512];
@@ -109,50 +109,12 @@ static char
}
char
- **p_split_args(char word[], int8_t redir)
+ **p_split_args(char word[])
{
char **words;
- size_t i;
words = NULL;
- if (redir == 0)
- {
- if ((words = p_split_words_no_rdr(word)) == NULL)
- return (NULL);
- return (words);
- }
- i = ft_strlen(word);
- while (ft_ischarset("<>", word[i]) == FALSE)
- i--;
- i--;
- while (redir > 0 && ft_isdigit(word[i]) == TRUE)
- i--;
- word[i] = C_NUL;
- if ((words = p_split_words_no_rdr(word)) == NULL)
+ if ((words = p_split_words(word)) == NULL)
return (NULL);
return (words);
- /* char **words; */
- /* char *subst; */
- /* size_t i; */
-
- /* if (redir == 0) */
- /* { */
- /* if (!(words = ft_split(word, ' '))) */
- /* return (NULL); */
- /* return (words); */
- /* } */
- /* i = 0; */
- /* while (word[i] && ft_ischarset("<>", word[i]) == FALSE) */
- /* i++; */
- /* while (redir > 0 && ft_isdigit(word[i]) == TRUE) */
- /* i--; */
- /* if (!(subst = ft_substr(word, 0, i))) */
- /* return (NULL); */
- /* if (!(words = ft_split(subst, ' '))) */
- /* { */
- /* ft_memdel((void*)&subst); */
- /* return (NULL); */
- /* } */
- /* ft_memdel((void*)&subst); */
- /* return (words); */
}