cmd: when extracting arg value, on not found return default

issue #2
This commit is contained in:
tylen 2024-09-26 19:11:06 +00:00 committed by Vasily Davydov
parent ccc67114f9
commit 384b5ceb3d

View File

@ -20,7 +20,7 @@ static const char* PREDEFINED_ARG_DESC [] = {
};
static const char* PREDEFINED_ARG_VALUES [] = {
"Curernt Working Directory",
NULL,
NULL
};
@ -147,7 +147,7 @@ const char* extract_value_from_arg(struct ArgList* list, ArgNameId id) {
return list->args[i].value;
}
}
return NULL;
return PREDEFINED_ARG_VALUES[id];
}
void free_arg_list(struct ArgList* list) {