From ee62c034f1c6133976039fa51c31b91816befd63 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 12 Sep 2020 20:25:07 +0200 Subject: Aliases done --- src/b_alias.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/b_alias.c') diff --git a/src/b_alias.c b/src/b_alias.c index badd281..daa6e99 100644 --- a/src/b_alias.c +++ b/src/b_alias.c @@ -23,20 +23,10 @@ #include "u_utils.h" static uint8_t - b_print_arg(const char arg[], t_msh *msh) + b_print_arg_next(char *ptr, const char arg[], t_bool invalid, t_msh *msh) { - char *ptr; char val[ARG_MAX]; - t_bool invalid; - ptr = (char*)arg; - invalid = FALSE; - while (*ptr != C_NUL && *ptr != C_EQUALS) - { - if (ft_iswhitespace(*ptr) == TRUE) - invalid = TRUE; - ptr++; - } if (*ptr == C_NUL) { if (u_get_alias_value(val, arg, ARG_MAX, msh) != 0) @@ -61,6 +51,23 @@ static uint8_t return (0); } +static uint8_t + b_print_arg(const char arg[], t_msh *msh) +{ + char *ptr; + t_bool invalid; + + ptr = (char*)arg; + invalid = FALSE; + while (*ptr != C_NUL && *ptr != C_EQUALS) + { + if (ft_iswhitespace(*ptr) == TRUE) + invalid = TRUE; + ptr++; + } + return (b_print_arg_next(ptr, arg, invalid, msh)); +} + static void b_register_arg(const char arg[], t_msh *msh) { -- cgit v1.2.3