version 1.40, 2021/08/21 08:44:59 |
version 1.41, 2021/08/21 10:28:05 |
|
|
RB_REMOVE(args_tree, &args->tree, entry); |
RB_REMOVE(args_tree, &args->tree, entry); |
TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) { |
TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) { |
TAILQ_REMOVE(&entry->values, value, entry); |
TAILQ_REMOVE(&entry->values, value, entry); |
free(value->value); |
free(value->string); |
free(value); |
free(value); |
} |
} |
free(entry); |
free(entry); |
|
|
args_print_add(&buf, &len, " -%c", entry->flag); |
args_print_add(&buf, &len, " -%c", entry->flag); |
else |
else |
args_print_add(&buf, &len, "-%c", entry->flag); |
args_print_add(&buf, &len, "-%c", entry->flag); |
args_print_add_argument(&buf, &len, value->value); |
args_print_add_argument(&buf, &len, value->string); |
} |
} |
} |
} |
|
|
|
|
|
|
if (s != NULL) { |
if (s != NULL) { |
value = xcalloc(1, sizeof *value); |
value = xcalloc(1, sizeof *value); |
value->value = xstrdup(s); |
value->string = xstrdup(s); |
TAILQ_INSERT_TAIL(&entry->values, value, entry); |
TAILQ_INSERT_TAIL(&entry->values, value, entry); |
} |
} |
} |
} |
|
|
return (NULL); |
return (NULL); |
if (TAILQ_EMPTY(&entry->values)) |
if (TAILQ_EMPTY(&entry->values)) |
return (NULL); |
return (NULL); |
return (TAILQ_LAST(&entry->values, args_values)->value); |
return (TAILQ_LAST(&entry->values, args_values)->string); |
} |
} |
|
|
/* Get first argument. */ |
/* Get first argument. */ |
|
|
} |
} |
value = TAILQ_LAST(&entry->values, args_values); |
value = TAILQ_LAST(&entry->values, args_values); |
|
|
ll = strtonum(value->value, minval, maxval, &errstr); |
ll = strtonum(value->string, minval, maxval, &errstr); |
if (errstr != NULL) { |
if (errstr != NULL) { |
*cause = xstrdup(errstr); |
*cause = xstrdup(errstr); |
return (0); |
return (0); |
|
|
*cause = xstrdup("missing"); |
*cause = xstrdup("missing"); |
return (0); |
return (0); |
} |
} |
value = TAILQ_LAST(&entry->values, args_values)->value; |
value = TAILQ_LAST(&entry->values, args_values)->string; |
return (args_string_percentage(value, minval, maxval, curval, cause)); |
return (args_string_percentage(value, minval, maxval, curval, cause)); |
} |
} |
|
|