diff options
| author | gingerBill <bill@gingerbill.org> | 2020-05-30 12:23:41 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-05-30 12:23:41 +0100 |
| commit | 84fd40de77deb71544fce7c3c34177ee2f9c4405 (patch) | |
| tree | 0f2c55f474c411343a6668b5c9af9791e8de8963 /src/ir.cpp | |
| parent | 1d7f99cbdf28236e8d55e7c36ec14c693d139f3f (diff) | |
Fix rules for recursive initialization with procedure entities; Fix executable name if not given
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 020b4ce44..f08c3569d 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -11485,9 +11485,17 @@ bool ir_gen_init(irGen *s, Checker *c) { if (build_context.out_filepath.len == 0) { s->output_name = remove_directory_from_path(init_fullpath); s->output_name = remove_extension_from_path(s->output_name); + s->output_name = string_trim_whitespace(s->output_name); + if (s->output_name.len == 0) { + s->output_name = c->info.init_scope->pkg->name; + } s->output_base = s->output_name; } else { s->output_name = build_context.out_filepath; + s->output_name = string_trim_whitespace(s->output_name); + if (s->output_name.len == 0) { + s->output_name = c->info.init_scope->pkg->name; + } isize pos = string_extension_position(s->output_name); if (pos < 0) { s->output_base = s->output_name; |