From 68f0f9536a2ca35b7d7cc4b7750f44d9d27c4bf5 Mon Sep 17 00:00:00 2001 From: narnaud Date: Fri, 27 May 2022 09:16:34 +0200 Subject: [PATCH] fix: little error on is_valid_ident --- errors.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/errors.c b/errors.c index e22ff59..fed724b 100644 --- a/errors.c +++ b/errors.c @@ -6,7 +6,7 @@ /* By: mea +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/05/06 13:15:59 by narnaud #+# #+# */ -/* Updated: 2022/05/27 08:47:01 by narnaud ### ########.fr */ +/* Updated: 2022/05/27 09:16:02 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ @@ -35,17 +35,17 @@ int is_valid_identifier(char *ident, int silent) if (!ft_isalpha(ident[i]) && !ft_isdigit(ident[i]) && ident[i] != '_') { - if (!silent) - cmd_error("export", "not an identifier: ", ident); - ft_putchar_fd('\n', 2); + if (!silent && cmd_error("export", + "not an identifier: ", ident)) + ft_putchar_fd('\n', 2); return (0); } i++; } return (1); } - if (!silent) - cmd_error("export", "not an identifier: ", ident); - ft_putchar_fd('\n', 2); + if (!silent && cmd_error("export", + "not an identifier: ", "\n")) + ft_putchar_fd('\n', 2); return (0); }