From 43c380abd2ee2cf3610f0d56adc9a2890a01ccc5 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 6 Jan 2026 16:06:53 +0900 Subject: [PATCH] config_format: cf_yaml: lign the behavior of dirname against POSIX When nothing found of directory separators on the given argument of dirname(), we need to align this behavior. After aligning the behavior, we can proceed to load configurations from specified workdir folders. Signed-off-by: Hiroshi Hatake --- src/config_format/flb_cf_yaml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config_format/flb_cf_yaml.c b/src/config_format/flb_cf_yaml.c index 6e64915a553..916093368d9 100644 --- a/src/config_format/flb_cf_yaml.c +++ b/src/config_format/flb_cf_yaml.c @@ -537,8 +537,10 @@ static char *dirname(char *path) ptr = strrchr(path, '\\'); if (ptr == NULL) { - return path; + /* No directory component */ + return "."; } + *ptr++='\0'; return path; }