diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-26 21:24:08 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-26 21:24:08 +0200 |
commit | f6517910eb0d6032a0678698d364987fb62158a5 (patch) | |
tree | e4fa4a3c5b29ce8d1a1174f8b6ff0529b2210421 /src/ft_p_lcom_next.c | |
parent | Better subst (diff) | |
download | 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.gz 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.bz2 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.xz 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.tar.zst 42-minishell-f6517910eb0d6032a0678698d364987fb62158a5.zip |
gdb time, strsubst might be broken
Diffstat (limited to 'src/ft_p_lcom_next.c')
-rw-r--r-- | src/ft_p_lcom_next.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ft_p_lcom_next.c b/src/ft_p_lcom_next.c index 34c0d2c..272931d 100644 --- a/src/ft_p_lcom_next.c +++ b/src/ft_p_lcom_next.c @@ -30,6 +30,8 @@ char p_words = words; varlen = 0; + varval = NULL; + s_varname = NULL; while (*p_words) { while ((i = ft_strlchr(*p_words, '$')) != -1) @@ -39,11 +41,11 @@ char varlen += 1; if (!(s_varname = ft_substr(*p_words, (uint32_t)i, varlen))) return (NULL); + ft_printf("a\n"); varval = ft_subst_var_value(s_varname, msh); *p_words = ft_strsubst(*p_words, s_varname, varval); ft_memdel((void*)&s_varname); ft_memdel((void*)&varval); - varlen += 1; } p_words += 1; } |