feat: add behavior.{source,user_source} for custom env

This commit is contained in:
2024-12-25 19:25:09 +01:00
parent 1e0ffcdf2f
commit 0ba5519937
5 changed files with 82 additions and 6 deletions

View File

@@ -109,6 +109,10 @@ u_char config_line_handler(char *k, char *v) {
__config->strings.s_shell = v;
else if (strcmp(k, "behavior.include_defshell") == 0)
__config->behavior.include_defshell = strcmp(v, "true") == 0;
else if (strcmp(k, "behavior.source") == 0)
vec_push(&__config->behavior.source, v);
else if (strcmp(k, "behavior.user_source") == 0)
vec_push(&__config->behavior.user_source, v);
else
return 0b1111;
@@ -124,6 +128,9 @@ struct config *parse_config(char *path) {
}
__config = malloc(sizeof(struct config));
__config->behavior.source = vec_new();
__config->behavior.user_source = vec_new();
if (__config == NULL)
return NULL;
bool ret = line_parser(fd, (ssize_t *)&sb.st_blksize, config_line_handler);