feat: add absolute path assertion

This commit is contained in:
Remi Gelinas
2024-07-21 10:19:46 -04:00
parent 699fce0ee5
commit c6cf13ac89

View File

@@ -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();