mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 18:06:33 +00:00
feat: add absolute path assertion
This commit is contained in:
@@ -1688,6 +1688,8 @@ pub fn loadIter(
|
|||||||
|
|
||||||
/// Load configuration from the target config file at `path`.
|
/// Load configuration from the target config file at `path`.
|
||||||
pub fn loadFile(self: *Config, alloc: Allocator, path: []const u8) !void {
|
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, .{});
|
var file = try std.fs.cwd().openFile(path, .{});
|
||||||
defer file.close();
|
defer file.close();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user