diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:24:54 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:24:54 +0200 |
commit | be81297dfc28503f7c1014aad4efcf52bd13aad1 (patch) | |
tree | 83fa07a0afac9752473dd2e76c40df46c02efe59 /src/p_args.c | |
parent | In progress (diff) | |
download | 42-minishell-be81297dfc28503f7c1014aad4efcf52bd13aad1.tar.gz 42-minishell-be81297dfc28503f7c1014aad4efcf52bd13aad1.tar.bz2 42-minishell-be81297dfc28503f7c1014aad4efcf52bd13aad1.tar.xz 42-minishell-be81297dfc28503f7c1014aad4efcf52bd13aad1.tar.zst 42-minishell-be81297dfc28503f7c1014aad4efcf52bd13aad1.zip |
am good
Diffstat (limited to 'src/p_args.c')
-rw-r--r-- | src/p_args.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/p_args.c b/src/p_args.c index a0da592..72182fd 100644 --- a/src/p_args.c +++ b/src/p_args.c @@ -84,11 +84,15 @@ static uint16_t uint16_t p_count_args(const char *head, char *ptr, uint16_t argc, size_t start[]) { + static uint16_t preset = 512; + if (*ptr == C_NULL) return (argc); while (*ptr != C_NULL && ft_iswhitespace(*ptr) == TRUE) ptr++; - start[argc] = ptr - head; + if (preset != argc) + start[argc] = ptr - head; + preset = argc; if (*ptr != C_SQUOTE && *ptr != C_DQUOTE && *ptr != C_NULL) { p_skip_clean_arg(head, &ptr, argc, start); |