diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-02 16:47:46 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-06-02 16:47:46 -0400 |
| commit | f030603f0dc9c487221a8f65f5a1ccb7b345a237 (patch) | |
| tree | fcd706de1a796056c03d60114fc981742e372aa2 | |
| parent | c07a46abc997a8fa2bb2b89cdd4ae97edd706340 (diff) | |
Fix #3660
This also prevents a segfault if you do `odin build .odin -file`
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4df6f97d5..80fc995cf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2657,6 +2657,10 @@ int main(int arg_count, char const **arg_ptr) { gb_printf_err("Expected either a directory or a .odin file, got '%.*s'\n", LIT(init_filename)); return 1; } + if (!gb_file_exists(cast(const char*)init_filename.text)) { + gb_printf_err("The file '%.*s' was not found.\n", LIT(init_filename)); + return 1; + } } } } |