Skip to content

Commit bc796b2

Browse files
cosmo0920edsiper
authored andcommitted
config_format: yaml: Use \ instead of / for concatenating paths on Windows
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 5a9a4e8 commit bc796b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/config_format/flb_cf_yaml.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,10 +1934,16 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
19341934
return -1;
19351935
}
19361936

1937-
if (flb_sds_printf(&include_dir, "%s/%s", parent->path, cfg_file) == NULL) {
1937+
#ifdef _WIN32
1938+
#define PATH_CONCAT_TEMPLATE "%s\\%s"
1939+
#else
1940+
#define PATH_CONCAT_TEMPLATE "%s/%s"
1941+
#endif
1942+
if (flb_sds_printf(&include_dir, PATH_CONCAT_TEMPLATE, parent->path, cfg_file) == NULL) {
19381943
flb_error("unable to create full filename");
19391944
return -1;
19401945
}
1946+
#undef PATH_CONCAT_TEMPLATE
19411947

19421948
}
19431949
else {

0 commit comments

Comments
 (0)