From 483f10bf0751b6eb4f534294e93cc3b1cc6a52bd Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Thu, 1 Aug 2024 12:07:42 +0200 Subject: [PATCH] Fix fields always ending with empty string --- src/execution.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.30.2