summaryrefslogtreecommitdiffstats
path: root/src/p_args.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-08 18:31:51 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-08 18:31:51 +0200
commitd0038f19a7cb23749588b72c9febcf114d9d31e9 (patch)
treee7daa5c0058d7d293d1d93fe9068d5ad59afcabe /src/p_args.c
parentIn progress (diff)
download42-minishell-d0038f19a7cb23749588b72c9febcf114d9d31e9.tar.gz
42-minishell-d0038f19a7cb23749588b72c9febcf114d9d31e9.tar.bz2
42-minishell-d0038f19a7cb23749588b72c9febcf114d9d31e9.tar.xz
42-minishell-d0038f19a7cb23749588b72c9febcf114d9d31e9.tar.zst
42-minishell-d0038f19a7cb23749588b72c9febcf114d9d31e9.zip
static hist, words fix
Diffstat (limited to 'src/p_args.c')
-rw-r--r--src/p_args.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/p_args.c b/src/p_args.c
index 383700f..78cfc06 100644
--- a/src/p_args.c
+++ b/src/p_args.c
@@ -116,9 +116,10 @@ static uint16_t
if (ft_iswhitespace(*ptr) &&
p_meet_whitespace((char*)word, ptr, mode) == TRUE)
{
- count += 1;
ptr = p_skip_whitespace(ptr);
- start[count - 1] = (ptr - word);
+ start[count] = (ptr - word);
+ if (*ptr != C_NUL)
+ count += 1;
ptr -= 1;
}
ptr++;