~jan0sch/rig
Showing details for patch 6b2f30122be33e22f5ca26a94428a2f0a369ffed.
diff -rN -u old-rig/src/main.zig new-rig/src/main.zig --- old-rig/src/main.zig 2025-04-19 15:45:58.292107621 +0000 +++ new-rig/src/main.zig 2025-04-19 15:45:58.292107621 +0000 @@ -81,6 +81,8 @@ return result; } +/// Try to return the content of a file by trying to read it from the given +/// path and fall back to the alternate one if the first read fails. fn readData(allocator: std.mem.Allocator, path: []const u8, alternate_path: []const u8) !std.ArrayList([]const u8) { const file = fs.openFileAbsolute(path, .{}) catch try fs.openFileAbsolute(alternate_path, .{}); defer file.close();