aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-10-20 21:19:40 +0100
committergingerBill <bill@gingerbill.org>2018-10-20 21:19:40 +0100
commit822e4894f2a37d372dcb46db5185ad2c4d140d98 (patch)
treea10cd02fb9f21c9fdab4d795fefa97b362b9a99d /src
parentce2e23849e21b4014edc895557b598387118cf0b (diff)
Minor logic change for reserved package names
Diffstat (limited to 'src')
-rw-r--r--src/parser.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 7a8e6770d..231a40e99 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4185,6 +4185,12 @@ bool determine_path_from_string(Parser *p, Ast *node, String base_dir, String or
return false;
}
+
+ if (is_package_name_reserved(file_str)) {
+ *path = file_str;
+ return true;
+ }
+
gb_mutex_lock(&p->file_decl_mutex);
defer (gb_mutex_unlock(&p->file_decl_mutex));
@@ -4223,12 +4229,9 @@ bool determine_path_from_string(Parser *p, Ast *node, String base_dir, String or
#endif
}
- if (is_package_name_reserved(file_str)) {
- *path = file_str;
- } else {
- String fullpath = string_trim_whitespace(get_fullpath_relative(a, base_dir, file_str));
- *path = fullpath;
- }
+
+ String fullpath = string_trim_whitespace(get_fullpath_relative(a, base_dir, file_str));
+ *path = fullpath;
return true;
}