summaryrefslogtreecommitdiffstats
path: root/src/m_loop_next.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-05 15:57:20 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-05 15:57:20 +0200
commit8e8508c068111729d74d43d51bd6f2f9b9e1cdc0 (patch)
tree71ae106df2588c5a25c60b76da47e16a38debf5d /src/m_loop_next.c
parentcommit (diff)
download42-minishell-8e8508c068111729d74d43d51bd6f2f9b9e1cdc0.tar.gz
42-minishell-8e8508c068111729d74d43d51bd6f2f9b9e1cdc0.tar.bz2
42-minishell-8e8508c068111729d74d43d51bd6f2f9b9e1cdc0.tar.xz
42-minishell-8e8508c068111729d74d43d51bd6f2f9b9e1cdc0.tar.zst
42-minishell-8e8508c068111729d74d43d51bd6f2f9b9e1cdc0.zip
In progress
Diffstat (limited to 'src/m_loop_next.c')
-rw-r--r--src/m_loop_next.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/m_loop_next.c b/src/m_loop_next.c
index 31751f2..4bb8f78 100644
--- a/src/m_loop_next.c
+++ b/src/m_loop_next.c
@@ -158,13 +158,13 @@ static t_bool
}
static t_bool
- m_find_next_quote(char **ptr, char line[], uint8_t mode)
+ m_find_next_quote(char **ptr, char line[], t_quote_mode mode)
{
char c;
- if (mode == FT_NO_MODE)
+ if (mode == Q_NONE)
return (FALSE);
- c = (mode == FT_SQ_MODE) ? (C_SQUOTE) : (C_DQUOTE);
+ c = (mode == Q_SINGLE) ? (C_SQUOTE) : (C_DQUOTE);
(*ptr) += 1;
while (**ptr != C_NULL)
{
@@ -189,11 +189,11 @@ static t_bool
static t_bool
m_check_missing_quotes(char line[])
{
- char *ptr;
- uint8_t mode;
+ char *ptr;
+ t_quote_mode mode;
ptr = line;
- mode = FT_NO_MODE;
+ mode = Q_NONE;
while (*ptr != C_NULL)
{
if (*ptr == C_SQUOTE || *ptr == C_DQUOTE)
@@ -202,9 +202,9 @@ static t_bool
((ptr - line) >= 1 && *(ptr - 1) != C_BS) ||
((ptr - line) > 1 && *(ptr - 1) == C_BS && *(ptr - 2) == C_BS))
{
- mode = (*ptr == C_SQUOTE) ? (FT_SQ_MODE) : (FT_DQ_MODE);
+ mode = (*ptr == C_SQUOTE) ? (Q_SINGLE) : (Q_DOUBLE);
if (m_find_next_quote(&ptr, line, mode) == FALSE)
- mode = FT_NO_MODE;
+ mode = Q_NONE;
else
return (TRUE);
}