This commit is contained in:
2024-04-26 13:47:08 +02:00
parent 6310a99dcb
commit 517f94fe48
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);