diff options
| author | arf20 <aruizfernandez05@gmail.com> | 2025-11-30 05:11:02 +0100 |
|---|---|---|
| committer | arf20 <aruizfernandez05@gmail.com> | 2025-11-30 05:11:02 +0100 |
| commit | b1430f0f2d76859eafda9fc6098c3b4876501471 (patch) | |
| tree | 467c0fc17fa40bf0eda18b830de54fc596add268 /config.c | |
| parent | ae9b7722e93111a8ee67e5b9b3a791df7b94c765 (diff) | |
| download | arfnet2-search-b1430f0f2d76859eafda9fc6098c3b4876501471.tar.gz arfnet2-search-b1430f0f2d76859eafda9fc6098c3b4876501471.zip | |
file indexing, stat, hash map tree insert
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -28,7 +28,7 @@ #include <errno.h> 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; } |
