summaryrefslogtreecommitdiff
path: root/src/colors.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
committerGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
commita479792a1ab2b593642d7f648194bfa23ce01dba (patch)
tree96ddee7d879a9084daa07db43b0b7910b072a785 /src/colors.zig
parente179cc44fe5060c76a5b00c41e53f11209f5acd9 (diff)
parent4c761893e5b3fdae422622cfa02104ab36633045 (diff)
downloadpardes-a479792a1ab2b593642d7f648194bfa23ce01dba.tar.gz
pardes-a479792a1ab2b593642d7f648194bfa23ce01dba.zip
Merge the upstream daemon and replicated client/server refactor
Diffstat (limited to 'src/colors.zig')
-rw-r--r--src/colors.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/colors.zig b/src/colors.zig
index c016434b..cc417ccb 100644
--- a/src/colors.zig
+++ b/src/colors.zig
@@ -677,14 +677,15 @@ pub fn requestThemeFile(p: *Pardes, id: usize, argument: []const u8) void {
}
const absolute = std.fs.path.isAbsolute(input);
- if (!absolute and p.opts.config_dir == null) {
+ const config_dir = if (absolute) null else p.configDir();
+ if (!absolute and config_dir == null) {
p.reportError(id, "theme file", error.NoConfigDirectory);
return;
}
var joined: [4095]u8 = undefined;
const resolved = if (absolute) input else path: {
- const dir = p.opts.config_dir.?;
+ const dir = config_dir.?;
const separator = if (dir.len > 0 and dir[dir.len - 1] != std.Io.Dir.path.sep) std.Io.Dir.path.sep_str else "";
break :path std.fmt.bufPrint(&joined, "{s}{s}{s}", .{ dir, separator, input }) catch {
p.reportError(id, "theme file", error.PathTooLong);