From b1430f0f2d76859eafda9fc6098c3b4876501471 Mon Sep 17 00:00:00 2001 From: arf20 Date: Sun, 30 Nov 2025 05:11:02 +0100 Subject: file indexing, stat, hash map tree insert --- config.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'config.c') diff --git a/config.c b/config.c index 1235a6b..bc9eed6 100644 --- a/config.c +++ b/config.c @@ -28,7 +28,7 @@ #include unsigned short port = 0; -char *tmpl_path = NULL; +char *tmpl_path = NULL, *root = NULL; int config_load(const char *conf_path) @@ -71,6 +71,10 @@ config_load(const char *conf_path) value[strlen(value) - 1] = '\0'; tmpl_path = strdup(value); printf("\ttemplate: %s\n", tmpl_path); + } else if (strcmp(line, "root") == 0) { + value[strlen(value) - 1] = '\0'; + root = strdup(value); + printf("\troot: %s\n", root); } else { fprintf(stderr, "[config] unknown key: %s\n", line); continue; @@ -89,6 +93,11 @@ config_load(const char *conf_path) tmpl_path = DEFAULT_TMPL_PATH; } + if (!root) { + fprintf(stderr, "[config] E: no root given\n"); + return -1; + } + return 0; } -- cgit v1.2.3