mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
config: RepeatableString.clone should clone all the strings too
This commit is contained in:
@ -2498,9 +2498,14 @@ pub const RepeatableString = struct {
|
|||||||
|
|
||||||
/// Deep copy of the struct. Required by Config.
|
/// Deep copy of the struct. Required by Config.
|
||||||
pub fn clone(self: *const Self, alloc: Allocator) !Self {
|
pub fn clone(self: *const Self, alloc: Allocator) !Self {
|
||||||
return .{
|
// Copy the list and all the strings in the list.
|
||||||
.list = try self.list.clone(alloc),
|
const list = try self.list.clone(alloc);
|
||||||
};
|
for (list.items) |*item| {
|
||||||
|
const copy = try alloc.dupeZ(u8, item.*);
|
||||||
|
item.* = copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
return .{ .list = list };
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The number of itemsin the list
|
/// The number of itemsin the list
|
||||||
|
Reference in New Issue
Block a user