diff --git a/src/config/Config.zig b/src/config/Config.zig index 809eb427d..6c705b96b 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -2203,11 +2203,11 @@ pub const RepeatableString = struct { const Self = @This(); // Allocator for the list is the arena for the parent config. - list: std.ArrayListUnmanaged([]const u8) = .{}, + list: std.ArrayListUnmanaged([:0]const u8) = .{}, pub fn parseCLI(self: *Self, alloc: Allocator, input: ?[]const u8) !void { const value = input orelse return error.ValueRequired; - const copy = try alloc.dupe(u8, value); + const copy = try alloc.dupeZ(u8, value); try self.list.append(alloc, copy); } @@ -2284,7 +2284,8 @@ pub const RepeatablePath = struct { // If it isn't absolute, we need to make it absolute relative // to the base. - const abs = dir.realpathAlloc(alloc, path) catch |err| { + var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; + const abs = std.os.realpath(path, &buf) catch |err| { try errors.add(alloc, .{ .message = try std.fmt.allocPrintZ( alloc, @@ -2300,7 +2301,7 @@ pub const RepeatablePath = struct { "expanding config-file path relative={s} abs={s}", .{ path, abs }, ); - self.value.list.items[i] = abs; + self.value.list.items[i] = try alloc.dupeZ(u8, abs); } } }; diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index 96b50dea4..00104ffa8 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -142,7 +142,7 @@ pub const DerivedConfig = struct { arena: ArenaAllocator, font_thicken: bool, - font_features: std.ArrayListUnmanaged([]const u8), + font_features: std.ArrayListUnmanaged([:0]const u8), font_styles: font.Group.StyleStatus, cursor_color: ?terminal.color.RGB, cursor_opacity: f64, @@ -154,7 +154,7 @@ pub const DerivedConfig = struct { selection_foreground: ?terminal.color.RGB, invert_selection_fg_bg: bool, min_contrast: f32, - custom_shaders: std.ArrayListUnmanaged([]const u8), + custom_shaders: std.ArrayListUnmanaged([:0]const u8), custom_shader_animation: bool, links: link.Set, diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index 699f51943..de7b3ffbf 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -239,7 +239,7 @@ pub const DerivedConfig = struct { arena: ArenaAllocator, font_thicken: bool, - font_features: std.ArrayListUnmanaged([]const u8), + font_features: std.ArrayListUnmanaged([:0]const u8), font_styles: font.Group.StyleStatus, cursor_color: ?terminal.color.RGB, cursor_text: ?terminal.color.RGB, @@ -251,7 +251,7 @@ pub const DerivedConfig = struct { selection_foreground: ?terminal.color.RGB, invert_selection_fg_bg: bool, min_contrast: f32, - custom_shaders: std.ArrayListUnmanaged([]const u8), + custom_shaders: std.ArrayListUnmanaged([:0]const u8), custom_shader_animation: bool, links: link.Set,