mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Err on empty directory packages
This commit is contained in:
+4
-1
@@ -751,7 +751,7 @@ enum ReadDirectoryError {
|
|||||||
ReadDirectory_NotExists,
|
ReadDirectory_NotExists,
|
||||||
ReadDirectory_Permission,
|
ReadDirectory_Permission,
|
||||||
ReadDirectory_NotDir,
|
ReadDirectory_NotDir,
|
||||||
ReadDirectory_EOF,
|
ReadDirectory_Empty,
|
||||||
ReadDirectory_Unknown,
|
ReadDirectory_Unknown,
|
||||||
|
|
||||||
ReadDirectory_COUNT,
|
ReadDirectory_COUNT,
|
||||||
@@ -858,6 +858,9 @@ ReadDirectoryError read_directory(String path, Array<FileInfo> *fi) {
|
|||||||
|
|
||||||
} while (FindNextFileW(find_file, &file_data));
|
} while (FindNextFileW(find_file, &file_data));
|
||||||
|
|
||||||
|
if (fi->count == 0) {
|
||||||
|
return ReadDirectory_Empty;
|
||||||
|
}
|
||||||
|
|
||||||
return ReadDirectory_None;
|
return ReadDirectory_None;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -4253,7 +4253,7 @@ ParseFileError parse_import(Parser *p, ImportedPackage imported_package) {
|
|||||||
GB_ASSERT(import_path != list[0].fullpath);
|
GB_ASSERT(import_path != list[0].fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rd_err != ReadDirectory_EOF && rd_err != ReadDirectory_None) {
|
if (rd_err != ReadDirectory_None) {
|
||||||
if (pos.line != 0) {
|
if (pos.line != 0) {
|
||||||
gb_printf_err("%.*s(%td:%td) ", LIT(pos.file), pos.line, pos.column);
|
gb_printf_err("%.*s(%td:%td) ", LIT(pos.file), pos.line, pos.column);
|
||||||
}
|
}
|
||||||
@@ -4282,9 +4282,9 @@ ParseFileError parse_import(Parser *p, ImportedPackage imported_package) {
|
|||||||
gb_printf_err("Unknown error whilst reading path %.*s\n", LIT(import_rel_path));
|
gb_printf_err("Unknown error whilst reading path %.*s\n", LIT(import_rel_path));
|
||||||
return ParseFile_InvalidFile;
|
return ParseFile_InvalidFile;
|
||||||
|
|
||||||
case ReadDirectory_EOF:
|
case ReadDirectory_Empty:
|
||||||
gb_printf_err("Unknown error whilst reading path %.*s\n", LIT(import_rel_path));
|
gb_printf_err("Empty directory: %.*s\n", LIT(import_rel_path));
|
||||||
return ParseFile_InvalidFile;
|
return ParseFile_EmptyFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user