summaryrefslogtreecommitdiffstats
path: root/src/s_lcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/s_lcom.c')
-rw-r--r--src/s_lcom.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/s_lcom.c b/src/s_lcom.c
index 31b14d6..773814f 100644
--- a/src/s_lcom.c
+++ b/src/s_lcom.c
@@ -49,11 +49,8 @@ static int8_t
j = 0;
while (i > 0 && j < i)
{
- if (!((*lcom)->argv[j] =
- (char*)malloc((ft_strlen(words[j]) + 1) * sizeof(char))))
+ if (!((*lcom)->argv[j] = ft_strdup(words[j])))
return (-1);
- ft_strlcpy((*lcom)->argv[j], words[j],
- ft_strlen(words[j]) + 1);
j++;
}
(*lcom)->argv[j] = 0;
@@ -134,6 +131,7 @@ t_lcom
return (NULL);
if (!(words = subst_vars(words, msh)))
return (NULL);
+ words = p_check_first_arg_equals(words);
if (fill_lcom(words, &link) < 0)
{
ft_delwords(words);