From 4eda4d335b1c2326b1bbd7f1291b0a1bd2f97fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Wed, 14 May 2025 05:45:29 +0200 Subject: [PATCH] feat(local_prov): fix path separator --- src/core/provider/local.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/provider/local.zig b/src/core/provider/local.zig index c60b111..bcccf76 100644 --- a/src/core/provider/local.zig +++ b/src/core/provider/local.zig @@ -56,18 +56,18 @@ pub const LocalContentProvider = struct { initContext: *const InitContext, allocator: std.mem.Allocator, ) GetItemsError!*Item { - const path = try std.mem.replaceOwned(u8, allocator, fullName.path, "/", "\\"); - defer allocator.free(path); + const native_path = try std.mem.replaceOwned(u8, allocator, fullName.path, "/", std.fs.path.sep_str); + defer allocator.free(native_path); const kind: union(enum) { directory, file } = blk: { // FIXME: properly handle different errors - var dir = std.fs.cwd().openDir(path, .{}); + var dir = std.fs.cwd().openDir(native_path, .{}); if (dir) |*d| { d.close(); break :blk .directory; } else |_| {} - var file = std.fs.cwd().openFile(path, .{}); + var file = std.fs.cwd().openFile(native_path, .{}); if (file) |*f| { f.close(); break :blk .file;