mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Fix #2809 - disallow files to start with _
This commit is contained in:
@@ -5988,6 +5988,16 @@ gb_internal ParseFileError process_imported_file(Parser *p, ImportedFile importe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
String name = file->fullpath;
|
||||||
|
name = remove_directory_from_path(name);
|
||||||
|
name = remove_extension_from_path(name);
|
||||||
|
|
||||||
|
if (string_starts_with(name, str_lit("_"))) {
|
||||||
|
syntax_error(pos, "Files cannot start with '_', got '%.*s'", LIT(file->fullpath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (build_context.command_kind == Command_test) {
|
if (build_context.command_kind == Command_test) {
|
||||||
String name = file->fullpath;
|
String name = file->fullpath;
|
||||||
name = remove_extension_from_path(name);
|
name = remove_extension_from_path(name);
|
||||||
@@ -5998,6 +6008,7 @@ gb_internal ParseFileError process_imported_file(Parser *p, ImportedFile importe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (parse_file(p, file)) {
|
if (parse_file(p, file)) {
|
||||||
MUTEX_GUARD_BLOCK(&pkg->files_mutex) {
|
MUTEX_GUARD_BLOCK(&pkg->files_mutex) {
|
||||||
array_add(&pkg->files, file);
|
array_add(&pkg->files, file);
|
||||||
|
|||||||
Reference in New Issue
Block a user