mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +00:00
more
This commit is contained in:
@@ -1916,19 +1916,7 @@ pub fn toNTPath(wbuf: []u16, utf8: []const u8) [:0]u16 {
|
||||
return wbuf[0 .. toWPathNormalized(wbuf[prefix.len..], utf8).len + prefix.len :0];
|
||||
}
|
||||
|
||||
pub fn toNTMaxPath(buf: []u8, utf8: []const u8) [:0]const u8 {
|
||||
if (!std.fs.path.isAbsoluteWindows(utf8) or utf8.len <= 260) {
|
||||
@memcpy(buf[0..utf8.len], utf8);
|
||||
buf[utf8.len] = 0;
|
||||
return buf[0..utf8.len :0];
|
||||
}
|
||||
|
||||
const prefix = bun.windows.nt_maxpath_prefix_u8;
|
||||
buf[0..prefix.len].* = prefix;
|
||||
return buf[0 .. toPathNormalized(buf[prefix.len..], utf8).len + prefix.len :0];
|
||||
}
|
||||
|
||||
pub fn addNTPathPrefix(wbuf: []u16, utf16: []const u16) [:0]u16 {
|
||||
fn addNTPathPrefix(wbuf: []u16, utf16: []const u16) [:0]u16 {
|
||||
wbuf[0..bun.windows.nt_object_prefix.len].* = bun.windows.nt_object_prefix;
|
||||
@memcpy(wbuf[bun.windows.nt_object_prefix.len..][0..utf16.len], utf16);
|
||||
wbuf[utf16.len + bun.windows.nt_object_prefix.len] = 0;
|
||||
|
||||
Reference in New Issue
Block a user