fix: remove extra slash in keybind config path

This commit is contained in:
CJ van den Berg 2024-12-11 21:27:19 +01:00
parent 8dea591341
commit c709ec0dc8
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -646,16 +646,16 @@ pub fn get_restore_file_name() ![]const u8 {
const keybind_dir = "keys";
pub fn get_keybind_namespaces_directory() ![]const u8 {
fn get_keybind_namespaces_directory() ![]const u8 {
const local = struct {
var dir_buffer: [std.posix.PATH_MAX]u8 = undefined;
};
const a = std.heap.c_allocator;
if (std.process.getEnvVarOwned(a, "FLOW_KEYS_DIR") catch null) |dir| {
defer a.free(dir);
return try std.fmt.bufPrint(&local.dir_buffer, "{s}/", .{dir});
return try std.fmt.bufPrint(&local.dir_buffer, "{s}", .{dir});
}
return try std.fmt.bufPrint(&local.dir_buffer, "{s}/{s}/", .{ try get_app_config_dir(application_name), keybind_dir });
return try std.fmt.bufPrint(&local.dir_buffer, "{s}/{s}", .{ try get_app_config_dir(application_name), keybind_dir });
}
pub fn get_keybind_namespace_file_name(namespace_name: []const u8) ![]const u8 {