diff --git a/src/main.zig b/src/main.zig index 492d49d..f22066e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -240,10 +240,10 @@ pub fn main(init: std.process.Init) !void { // Test for presence of Lua config file first // If it fails, fall back to ini var config_path = try std.Io.Dir.path.join(state.allocator, &[_][]const u8{ config_parent_path, "config.lua" }); - if (std.Io.Dir.accessAbsolute(state.io, config_path, .{})) |_| {} else |_| { + std.Io.Dir.accessAbsolute(state.io, config_path, .{}) catch { state.allocator.free(config_path); config_path = try std.Io.Dir.path.join(state.allocator, &[_][]const u8{ config_parent_path, "config.ini" }); - } + }; defer state.allocator.free(config_path); custom.binds = .empty;