summaryrefslogtreecommitdiff
path: root/core/dump.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/dump.zig')
-rw-r--r--core/dump.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/dump.zig b/core/dump.zig
index 2dde9c8c..2806e445 100644
--- a/core/dump.zig
+++ b/core/dump.zig
@@ -639,6 +639,7 @@ fn loadAndRevive(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, previ
var on_disk: OnDisk = @splat(false);
const p = try loadKnowing(gpa, opts, bytes, &notes, &on_disk);
errdefer p.deinit();
+ dropOldTags(p);
// The 9P state its requests made was its connections', which do not
// come with it (a client's join loads alone, and keeps it).
p.fs.forget(gpa);
@@ -661,6 +662,20 @@ fn loadAndRevive(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, previ
return p;
}
+/// A build before UX K' kept a tag's command words as its own text: one a
+/// dump restores equal to what its kind's tag said then (tagline.kindTail)
+/// is dropped, its words computed now (K'1); any other is the user's text,
+/// kept as it is. Here, where a Restore, a start from a dump and an
+/// Upgrade load (a replica's join loads its authority's, dropped there).
+fn dropOldTags(p: *Pardes) void {
+ for (p.panes) |slot| if (slot) |pane| if (pane.tag.own) |own| {
+ if (!std.mem.eql(u8, own, pardes.tagline.kindTail(pane))) continue;
+ p.gpa.free(own);
+ pane.tag.own = null;
+ pane.tag.cur_pinned = false;
+ };
+}
+
/// A loaded core given to this host (with `revivePane` for each of its
/// panes): the store and Recent read (a Restore's carried from the session
/// it replaces, with its state file) and its ThemeFile asked for again. An