aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-04-20 16:52:09 +0100
committergingerBill <bill@gingerbill.org>2019-04-20 16:52:09 +0100
commit9ce8f124bbea3fd7ee168380bafefed011ce71cc (patch)
tree1a4727ea7d45a55038cd525c7216d18359e54062
parent63bbb9b62fe60765b9101e3622592a2ab120a06d (diff)
Slight change to determine_path_from_string rules
-rw-r--r--src/parser.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index d17efd092..5e987d886 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4197,6 +4197,8 @@ bool is_package_name_reserved(String const &name) {
bool determine_path_from_string(gbMutex *file_mutex, Ast *node, String base_dir, String original_string, String *path) {
GB_ASSERT(path != nullptr);
+ // NOTE(bill): if file_mutex == nullptr, this means that the code is used within the semantics stage
+
gbAllocator a = heap_allocator();
String collection_name = {};
@@ -4210,10 +4212,12 @@ bool determine_path_from_string(gbMutex *file_mutex, Ast *node, String base_dir,
bool has_windows_drive = false;
#if defined(GB_SYSTEM_WINDOWS)
- if (colon_pos == 1 && original_string.len > 2) {
- if (original_string[2] == '/' || original_string[2] == '\\') {
- colon_pos = -1;
- has_windows_drive = true;
+ if (file_mutex == nullptr) {
+ if (colon_pos == 1 && original_string.len > 2) {
+ if (original_string[2] == '/' || original_string[2] == '\\') {
+ colon_pos = -1;
+ has_windows_drive = true;
+ }
}
}
#endif