Skip to content

Commit 797031c

Browse files
cosmo0920edsiper
authored andcommitted
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 <hiroshi@chronosphere.io>
1 parent 12ca05e commit 797031c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/config_format/flb_cf_yaml.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,10 @@ static char *dirname(char *path)
537537
ptr = strrchr(path, '\\');
538538

539539
if (ptr == NULL) {
540-
return path;
540+
/* No directory component */
541+
return ".";
541542
}
543+
542544
*ptr++='\0';
543545
return path;
544546
}

0 commit comments

Comments
 (0)