Change the file name rules for imports (use / rather than \ on windows)

This commit is contained in:
gingerBill
2019-04-20 16:47:28 +01:00
parent 56c4039e72
commit 63bbb9b62f
3 changed files with 48 additions and 12 deletions

View File

@@ -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);