diff options
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); |