Browse Source

fix: little error on is_valid_ident

master
narnaud 3 years ago
parent
commit
68f0f9536a
  1. 10
      errors.c

10
errors.c

@ -6,7 +6,7 @@
/* By: mea <marvin@42.fr> +#+ +:+ +#+ */ /* By: mea <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/06 13:15:59 by narnaud #+# #+# */ /* 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,8 +35,8 @@ int is_valid_identifier(char *ident, int silent)
if (!ft_isalpha(ident[i]) && !ft_isdigit(ident[i]) if (!ft_isalpha(ident[i]) && !ft_isdigit(ident[i])
&& ident[i] != '_') && ident[i] != '_')
{ {
if (!silent) if (!silent && cmd_error("export",
cmd_error("export", "not an identifier: ", ident); "not an identifier: ", ident))
ft_putchar_fd('\n', 2); ft_putchar_fd('\n', 2);
return (0); return (0);
} }
@ -44,8 +44,8 @@ int is_valid_identifier(char *ident, int silent)
} }
return (1); return (1);
} }
if (!silent) if (!silent && cmd_error("export",
cmd_error("export", "not an identifier: ", ident); "not an identifier: ", "\n"))
ft_putchar_fd('\n', 2); ft_putchar_fd('\n', 2);
return (0); return (0);
} }

Loading…
Cancel
Save