summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-03 15:54:11 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-03 15:54:11 +0200
commitf1861c0eae42c0590261fb7726dcca92a773d0c1 (patch)
tree56f9db7d709cb19f1c0560cf56707b7e2bebece6
parentNormed p_split (diff)
download42-minishell-f1861c0eae42c0590261fb7726dcca92a773d0c1.tar.gz
42-minishell-f1861c0eae42c0590261fb7726dcca92a773d0c1.tar.bz2
42-minishell-f1861c0eae42c0590261fb7726dcca92a773d0c1.tar.xz
42-minishell-f1861c0eae42c0590261fb7726dcca92a773d0c1.tar.zst
42-minishell-f1861c0eae42c0590261fb7726dcca92a773d0c1.zip
Normed p_split
-rw-r--r--src/p_split.c12
-rw-r--r--src/p_split.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/p_split.c b/src/p_split.c
index 359b97e..57ba6d6 100644
--- a/src/p_split.c
+++ b/src/p_split.c
@@ -26,22 +26,22 @@ static void p_meet_splitter(char *ptr,
t_split_block *sp,
t_quote_mode mode)
{
- if (mode == Q_NONE && *ptr == C_SEMIC && *(ptr + 1) != C_SEMIC &&
- u_is_not_escaped(line, ptr) == TRUE)
+ if (mode == Q_NONE && *ptr == C_SEMIC && *(ptr + 1) != C_SEMIC
+ && u_is_not_escaped(line, ptr) == TRUE)
{
sp->pos[sp->count] = (ptr - line);
sp->nextif[sp->count] = 0;
sp->count += 1;
}
- else if (mode == Q_NONE && *ptr == C_AMP && *(ptr + 1) == C_AMP &&
- (*ptr + 2) != C_PIPE && u_is_not_escaped(line, ptr) == TRUE)
+ else if (mode == Q_NONE && *ptr == C_AMP && *(ptr + 1) == C_AMP
+ && (*ptr + 2) != C_PIPE && u_is_not_escaped(line, ptr) == TRUE)
{
sp->pos[sp->count] = (ptr - line);
sp->nextif[sp->count] = 1;
sp->count += 1;
}
- else if (mode == Q_NONE && *ptr == C_PIPE && *(ptr + 1) == C_PIPE &&
- *(ptr + 2) != C_PIPE && u_is_not_escaped(line, ptr) == TRUE)
+ else if (mode == Q_NONE && *ptr == C_PIPE && *(ptr + 1) == C_PIPE
+ && *(ptr + 2) != C_PIPE && u_is_not_escaped(line, ptr) == TRUE)
{
sp->pos[sp->count] = (ptr - line);
sp->nextif[sp->count] = 2;
diff --git a/src/p_split.h b/src/p_split.h
index 85f663f..70d368f 100644
--- a/src/p_split.h
+++ b/src/p_split.h
@@ -20,6 +20,6 @@ typedef struct s_split_block
uint32_t count;
} t_split_block;
-char **p_split_line(char line[]);
+char **p_split_line(char line[]);
#endif