diff --git a/src/util/funcs.zig b/src/util/funcs.zig index 118543164d75eae76a6a60e9072166c8756a8d38..8cc3dc4cba7b60f44b2f823f82d4c201b0e0702f 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -41,7 +41,10 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 { } pub fn does_file_exist(fpath: []const u8) !bool { - const abs_path = try std.fs.realpathAlloc(gpa, fpath); + const abs_path = std.fs.realpathAlloc(gpa, fpath) catch |e| switch (e) { + error.FileNotFound => return false, + else => return e, + }; const file = std.fs.openFileAbsolute(abs_path, .{}) catch |e| switch (e) { error.FileNotFound => return false, else => return e,