Fix .exe path is directory check.

This commit is contained in:
Jeroen van Rijn
2024-07-22 16:11:33 +02:00
parent a39b6de18c
commit 90a4d12b30

View File

@@ -6543,10 +6543,9 @@ gb_internal ParseFileError parse_packages(Parser *p, String init_filename) {
}
if ((build_context.command_kind & Command__does_build) &&
build_context.build_mode == BuildMode_Executable) {
String short_path = filename_from_path(path);
char *cpath = alloc_cstring(temporary_allocator(), short_path);
if (gb_file_exists(cpath)) {
String output_path = path_to_string(temporary_allocator(), build_context.build_paths[8]);
char *cpath = alloc_cstring(temporary_allocator(), output_path);
if (path_is_directory(output_path) && gb_file_exists(cpath)) {
error({}, "Please specify the executable name with -out:<string> as a directory exists with the same name in the current working directory");
return ParseFile_DirectoryAlreadyExists;
}