diff --git a/src/parser.cpp b/src/parser.cpp index 277a405b7..fe864a6bc 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6023,6 +6023,12 @@ gb_internal bool determine_path_from_string(BlockingMutex *file_mutex, Ast *node has_windows_drive = true; } } + + for (isize i = 0; i < original_string.len; i++) { + if (original_string.text[i] == '\\') { + original_string.text[i] = '/'; + } + } } #endif diff --git a/tests/issues/run.bat b/tests/issues/run.bat index 9106a339b..f17f646a6 100644 --- a/tests/issues/run.bat +++ b/tests/issues/run.bat @@ -28,6 +28,7 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style -ignore-unused ..\..\..\odin test ..\test_issue_5699.odin %COMMON% || exit /b ..\..\..\odin test ..\test_issue_6068.odin %COMMON% || exit /b ..\..\..\odin test ..\test_issue_6101.odin %COMMON% || exit /b +..\..\..\odin test ..\test_issue_6165.odin %COMMON% || exit /b @echo off diff --git a/tests/issues/run.sh b/tests/issues/run.sh index 58382c7ad..73d0d9587 100755 --- a/tests/issues/run.sh +++ b/tests/issues/run.sh @@ -35,7 +35,7 @@ $ODIN build ../test_issue_5265.odin $COMMON $ODIN test ../test_issue_5699.odin $COMMON $ODIN test ../test_issue_6068.odin $COMMON $ODIN test ../test_issue_6101.odin $COMMON - +$ODIN test ../test_issue_6165.odin $COMMON set +x popd diff --git a/tests/issues/test_issue_6165.odin b/tests/issues/test_issue_6165.odin new file mode 100644 index 000000000..b16995f0e --- /dev/null +++ b/tests/issues/test_issue_6165.odin @@ -0,0 +1,13 @@ +// Tests issue #6165 https://github.com/odin-lang/Odin/issues/6165 +package test_issues + +import "core:testing" + +@(test) +test_issue_6165 :: proc(t: ^testing.T) { + TXT :: #load(ODIN_ROOT + "LICENSE") + + // We don't really care about the length. The test is whether this compiles, or + // if the compiler says it can't find the file we know to exist. + assert(len(TXT) > 0) +} \ No newline at end of file