Skip to content

Commit 318883f

Browse files
committed
CDRIVER-959 delimit test paths with "/"
1 parent b9b1c0b commit 318883f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/json-test.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,16 @@ test_server_selection_logic_cb (bson_t *test)
512512
* Given a parent directory and filename, compile a full path to
513513
* the child file.
514514
*
515+
* "dst" receives the joined path, delimited by "/" even on Windows.
516+
*
515517
*-----------------------------------------------------------------------
516518
*/
517519
void
518520
assemble_path (const char *parent_path,
519521
const char *child_name,
520522
char *dst /* OUT */)
521523
{
524+
char *p;
522525
int path_len = (int) strlen (parent_path);
523526
int name_len = (int) strlen (child_name);
524527

@@ -528,6 +531,12 @@ assemble_path (const char *parent_path,
528531
strncat (dst, parent_path, path_len);
529532
strncat (dst, "/", 1);
530533
strncat (dst, child_name, name_len);
534+
535+
for (p = dst; *p; ++p) {
536+
if (*p == '\\') {
537+
*p = '/';
538+
}
539+
}
531540
}
532541

533542
/*

0 commit comments

Comments
 (0)