mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
29 lines
1.4 KiB
C
29 lines
1.4 KiB
C
/* ************************************************************************** */
|
||
/* */
|
||
/* ::: :::::::: */
|
||
/* metacharacter.c :+: :+: :+: */
|
||
/* +:+ +:+ +:+ */
|
||
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
|
||
/* +#+#+#+#+#+ +#+ */
|
||
/* Created: 2025/02/06 15:23:31 by kcolin #+# #+# */
|
||
/* Updated: 2025/02/11 19:04:03 by kcolin ### ########.fr */
|
||
/* */
|
||
/* ************************************************************************** */
|
||
|
||
#include "metacharacter.h"
|
||
|
||
// FIXME: use ft_strchr
|
||
/*
|
||
** 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 ‘>’.
|
||
*/
|
||
bool is_metacharacter(char c)
|
||
{
|
||
if (c == ' ' || c == '\t' || c == '\n' || c == '|' || c == '&'
|
||
|| c == '(' || c == ')' || c == '<' || c == '>')
|
||
return (true);
|
||
return (false);
|
||
}
|