summaryrefslogtreecommitdiffstats
path: root/src/m_loop_next.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-05 17:03:49 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-05 17:03:49 +0200
commit247023e3fac41c99b5580d69262837429fb2bfed (patch)
treef8cf9e42cffa38b8b0062512fc24bb4404386c42 /src/m_loop_next.c
parentNot quite done yet (diff)
download42-minishell-247023e3fac41c99b5580d69262837429fb2bfed.tar.gz
42-minishell-247023e3fac41c99b5580d69262837429fb2bfed.tar.bz2
42-minishell-247023e3fac41c99b5580d69262837429fb2bfed.tar.xz
42-minishell-247023e3fac41c99b5580d69262837429fb2bfed.tar.zst
42-minishell-247023e3fac41c99b5580d69262837429fb2bfed.zip
Fuck shell
Diffstat (limited to 'src/m_loop_next.c')
-rw-r--r--src/m_loop_next.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/m_loop_next.c b/src/m_loop_next.c
index 4bb8f78..3bc85e8 100644
--- a/src/m_loop_next.c
+++ b/src/m_loop_next.c
@@ -18,6 +18,7 @@
#include "m_loop_next.h"
#include "m_prompt.h"
#include "s_struct.h"
+#include "u_utils.h"
static char
*m_counter_line_backslash(int32_t fd, uint8_t psx, char *line, t_msh *msh)
@@ -198,9 +199,7 @@ static t_bool
{
if (*ptr == C_SQUOTE || *ptr == C_DQUOTE)
{
- if (((ptr - line) == 0) ||
- ((ptr - line) >= 1 && *(ptr - 1) != C_BS) ||
- ((ptr - line) > 1 && *(ptr - 1) == C_BS && *(ptr - 2) == C_BS))
+ if (u_is_true_quote(line, ptr) == TRUE)
{
mode = (*ptr == C_SQUOTE) ? (Q_SINGLE) : (Q_DOUBLE);
if (m_find_next_quote(&ptr, line, mode) == FALSE)