Skip to content

Commit c903d19

Browse files
committed
fix: update GSettings schema path format to remove trailing slash
1 parent 016173d commit c903d19

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

data/ghostty.gschema.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<schemalist>
3-
<schema id="@APPID@" path="/@APPID_PATH@/">
3+
<schema id="@APPID@" path="@APPID_PATH@">
44
<key name="window-size" type="(uu)">
55
<default>(0, 0)</default>
66
<summary>Last window size</summary>

src/build/GhosttyResources.zig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,13 @@ fn addLinuxAppResources(
350350
break :templates try ts.toOwnedSlice(b.allocator);
351351
};
352352

353-
// Convert app_id to path format (com.mitchellh.ghostty -> /com/mitchellh/ghostty)
353+
// Convert app_id to path format (com.mitchellh.ghostty -> /com/mitchellh/ghostty/)
354354
const app_id_path = appid_path: {
355-
const path = try b.allocator.alloc(u8, app_id.len);
356-
for (app_id, 0..) |c, i| {
357-
path[i] = if (c == '.') '/' else c;
358-
}
355+
const path = try b.allocator.alloc(u8, app_id.len + 2);
356+
path[0] = '/';
357+
@memcpy(path[1 .. app_id.len + 1], app_id);
358+
std.mem.replaceScalar(u8, path[1 .. app_id.len + 1], '.', '/');
359+
path[path.len - 1] = '/';
359360
break :appid_path path;
360361
};
361362

0 commit comments

Comments
 (0)