From 517f94fe48dcde89a00c23ce549e1e468254b1f6 Mon Sep 17 00:00:00 2001 From: tomoron Date: Fri, 26 Apr 2024 13:47:08 +0200 Subject: [PATCH] () (()) --- srcs/get_len_bonus.c | 4 ++-- srcs/lst_cmd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/srcs/get_len_bonus.c b/srcs/get_len_bonus.c index bb227d9..26a7c2e 100644 --- a/srcs/get_len_bonus.c +++ b/srcs/get_len_bonus.c @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/24 14:51:00 by tomoron #+# #+# */ -/* Updated: 2024/04/24 14:59:47 by tomoron ### ########.fr */ +/* Updated: 2024/04/26 13:29:23 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" @@ -73,7 +73,7 @@ int get_parenthesis_cmd_len(char *cmd) if (cmd[len] == '"' && !in_quote) in_dquote = !in_dquote; if ((cmd[len] == '(' || cmd[len] == ')') && !in_quote && !in_dquote) - parenthesis += 1 * (-(cmd[len] == ')')); + parenthesis += 1 - ((cmd[len] == ')') * 2); len++; } return (len - 1); diff --git a/srcs/lst_cmd.c b/srcs/lst_cmd.c index d6ce291..007845c 100755 --- a/srcs/lst_cmd.c +++ b/srcs/lst_cmd.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/06 20:46:19 by tomoron #+# #+# */ -/* Updated: 2024/04/18 20:48:55 by marde-vr ### ########.fr */ +/* Updated: 2024/04/26 13:45:08 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,7 +17,7 @@ t_cmd *cmd_add_back(t_cmd *cmd, char *value, t_cmd_type type) t_cmd *res; t_cmd *current; - if (value && !*value) + if (value && !*value && type != PAREN) { free(value); return (cmd);