diff options
| author | gingerBill <bill@gingerbill.org> | 2019-04-20 16:47:28 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-04-20 16:47:28 +0100 |
| commit | 63bbb9b62fe60765b9101e3622592a2ab120a06d (patch) | |
| tree | 8b780826b1ab79edd8d8372d5cb4866dec3bfa65 /src/build_settings.cpp | |
| parent | 56c4039e72e569448e8d2fc79a40245e1dc13efa (diff) | |
Change the file name rules for imports (use / rather than \ on windows)
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 2b8f99e4c..d3e892175 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -443,6 +443,13 @@ String path_to_fullpath(gbAllocator a, String s) { text[len] = 0; result = string16_to_string(a, make_string16(text, len)); result = string_trim_whitespace(result); + + // Replace Windows style separators + for (isize i = 0; i < result.len; i++) { + if (result[i] == '\\') { + result[i] = '/'; + } + } } return result; @@ -471,6 +478,7 @@ String get_fullpath_relative(gbAllocator a, String base_dir, String path) { gb_memmove(str+i, path.text, path.len); i += path.len; str[i] = 0; + String res = make_string(str, i); res = string_trim_whitespace(res); return path_to_fullpath(a, res); |