diff --git a/HISTORY b/HISTORY index 340331d..24140b9 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,7 @@ +Version 1.60 2022-08-19 + * normalize_path for base_path + Version 1.59 2022-07-21 * open file with flag O_CLOEXEC * add global var g_set_cloexec and macro FC_SET_CLOEXEC diff --git a/src/process_ctrl.c b/src/process_ctrl.c index 17ce452..3c8631c 100644 --- a/src/process_ctrl.c +++ b/src/process_ctrl.c @@ -294,7 +294,7 @@ int get_base_path_from_conf_file(const char *filename, char *base_path, do { pBasePath = iniGetStrValue(NULL, "base_path", &iniContext); - if (pBasePath == NULL) + if (pBasePath == NULL || *pBasePath == '\0') { logError("file: "__FILE__", line: %d, " \ "conf file \"%s\" must have item " \ @@ -303,7 +303,7 @@ int get_base_path_from_conf_file(const char *filename, char *base_path, break; } - snprintf(base_path, path_size, "%s", pBasePath); + normalize_path(NULL, pBasePath, base_path, path_size); chopPath(base_path); if (!fileExists(base_path)) {