Skip to content

Commit

Permalink
config_format: yaml: Use \ instead of / for concatenating paths on Wi…
Browse files Browse the repository at this point in the history
…ndows

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Dec 21, 2023
1 parent 5a9a4e8 commit bc796b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config_format/flb_cf_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -1934,10 +1934,16 @@ static int read_config(struct flb_cf *conf, struct local_ctx *ctx,
return -1;
}

if (flb_sds_printf(&include_dir, "%s/%s", parent->path, cfg_file) == NULL) {
#ifdef _WIN32
#define PATH_CONCAT_TEMPLATE "%s\\%s"
#else
#define PATH_CONCAT_TEMPLATE "%s/%s"
#endif
if (flb_sds_printf(&include_dir, PATH_CONCAT_TEMPLATE, parent->path, cfg_file) == NULL) {
flb_error("unable to create full filename");
return -1;
}
#undef PATH_CONCAT_TEMPLATE

}
else {
Expand Down

0 comments on commit bc796b2

Please sign in to comment.