diff options
Diffstat (limited to '')
-rw-r--r-- | src/b_export.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/b_export.c b/src/b_export.c index 43e1c7d..fa9a6d1 100644 --- a/src/b_export.c +++ b/src/b_export.c @@ -26,7 +26,7 @@ #include "u_vars.h" static t_bool - check_valid_identifier(const char *arg) + check_valid_identifier(const char arg[]) { char *ptr; @@ -47,7 +47,9 @@ static t_bool while (*ptr != '\0') { if (*ptr == '=') + { return (TRUE); + } ptr++; } return (FALSE); @@ -86,25 +88,24 @@ uint8_t t_msh *msh) { /* TODO: norme */ - const uint64_t argc = u_builtins_get_argc((const char**)args); - char **ptr; - char *varval; - char fmt[4096]; - t_bool next; - uint8_t r; + char **ptr; + char *varval; + char fmt[4096]; + t_bool next; + uint8_t r; - if (argc == 0) + if (args[0] == NULL) { return (b_env(NULL, msh)); } - ptr = args; r = 0; - while (*ptr) + ptr = args; + while (*ptr != NULL) { next = FALSE; if (check_valid_identifier(*ptr) == FALSE) { - f_fail_identifier("export", *ptr, msh); + f_fail_identifier("export", *ptr); next = TRUE; r = 1; } |