From: Lukas Jiriste Date: Thu, 1 Aug 2024 10:07:42 +0000 (+0200) Subject: Fix fields always ending with empty string X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=483f10bf0751b6eb4f534294e93cc3b1cc6a52bd;p=42%2Fminishell.git Fix fields always ending with empty string --- diff --git a/src/execution.c b/src/execution.c index 1fa0302..bf4d325 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */ -/* Updated: 2024/08/01 11:48:48 by ljiriste ### ########.fr */ +/* Updated: 2024/08/01 12:07:31 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -524,6 +524,8 @@ char **quoted_split(const char *str) while (str[i] == ' ') ++i; n = get_next_word_size(str + i); + if (n == 0) + break ; new_str = ft_strndup(str + i, n); if (!new_str) {