From c6cf13ac89965bd84279f5f44e7fedccd70bf1a7 Mon Sep 17 00:00:00 2001 From: Remi Gelinas Date: Sun, 21 Jul 2024 10:19:46 -0400 Subject: [PATCH] feat: add absolute path assertion --- src/config/Config.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config/Config.zig b/src/config/Config.zig index 090c8a77d..65a0591da 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -1688,6 +1688,8 @@ pub fn loadIter( /// Load configuration from the target config file at `path`. pub fn loadFile(self: *Config, alloc: Allocator, path: []const u8) !void { + assert(std.fs.path.isAbsolute(path)); + var file = try std.fs.cwd().openFile(path, .{}); defer file.close();