fix: ';' is not a metacharacter

Co-authored-by: jguelen <jguelen@student.42lehavre.fr>
This commit is contained in:
Khaïs COLIN 2025-02-11 18:24:30 +01:00
parent e877b8dbd5
commit 6e1552a35d
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
2 changed files with 16 additions and 9 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/06 15:23:31 by kcolin #+# #+# */
/* Updated: 2025/02/06 15:47:42 by kcolin ### ########.fr */
/* Updated: 2025/02/11 19:04:03 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,14 +16,13 @@
/*
** return true if the character is a metacharacter
**
** Bash reference manual:
** A character that, when unquoted, separates words. A metacharacter is a space,
** tab, newline, or one of the following characters: |, &, ;, (, ),
** <, or >.
** Bash reference manual: A character that, when unquoted, separates words. A
** metacharacter is a space, tab, newline, or one of the following characters:
** |, &, (, ), <, or >.
*/
bool is_metacharacter(char c)
{
if (c == ' ' || c == '\t' || c == '\n' || c == '|' || c == '&' || c == ';'
if (c == ' ' || c == '\t' || c == '\n' || c == '|' || c == '&'
|| c == '(' || c == ')' || c == '<' || c == '>')
return (true);
return (false);