fix: always use cross platform path separators
This commit is contained in:
parent
67af608357
commit
3bb3def510
1 changed files with 2 additions and 2 deletions
|
|
@ -167,7 +167,7 @@ pub fn Create(comptime variant: Variant) type {
|
||||||
else blk: {
|
else blk: {
|
||||||
var cwd_buf: [std.fs.max_path_bytes]u8 = undefined;
|
var cwd_buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||||
const cwd = std.fs.cwd().realpath(".", &cwd_buf) catch return error.WatchFailed;
|
const cwd = std.fs.cwd().realpath(".", &cwd_buf) catch return error.WatchFailed;
|
||||||
break :blk std.fmt.bufPrint(&buf, "{s}/{s}", .{ cwd, path }) catch return error.WatchFailed;
|
break :blk std.fmt.bufPrint(&buf, "{s}{c}{s}", .{ cwd, std.fs.path.sep, path }) catch return error.WatchFailed;
|
||||||
};
|
};
|
||||||
try self.interceptor.backend.add_watch(self.allocator, abs_path);
|
try self.interceptor.backend.add_watch(self.allocator, abs_path);
|
||||||
if (!Backend.watches_recursively) {
|
if (!Backend.watches_recursively) {
|
||||||
|
|
@ -272,7 +272,7 @@ pub fn Create(comptime variant: Variant) type {
|
||||||
while (it.next() catch return) |entry| {
|
while (it.next() catch return) |entry| {
|
||||||
if (entry.kind != .directory) continue;
|
if (entry.kind != .directory) continue;
|
||||||
var buf: [std.fs.max_path_bytes]u8 = undefined;
|
var buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||||
const sub = std.fmt.bufPrint(&buf, "{s}/{s}", .{ dir_path, entry.name }) catch continue;
|
const sub = std.fmt.bufPrint(&buf, "{s}{c}{s}", .{ dir_path, std.fs.path.sep, entry.name }) catch continue;
|
||||||
backend.add_watch(allocator, sub) catch {};
|
backend.add_watch(allocator, sub) catch {};
|
||||||
recurse_watch(backend, allocator, sub);
|
recurse_watch(backend, allocator, sub);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue