From 2294106906f5549f8a7ef5e044d2f9b59b0e814d Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Tue, 21 Jan 2025 01:56:12 -0800 Subject: [PATCH] a --- src/bun.js/node/node_fs.zig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig index 0f3bf4214e..53cfa44c61 100644 --- a/src/bun.js/node/node_fs.zig +++ b/src/bun.js/node/node_fs.zig @@ -3910,6 +3910,11 @@ pub const NodeFS = struct { } pub fn mkdir(this: *NodeFS, args: Arguments.Mkdir, _: Flavor) Maybe(Return.Mkdir) { + if (args.path.slice().len == 0) return .{ .err = .{ + .errno = @intFromEnum(bun.C.E.NOENT), + .syscall = .mkdir, + .path = "", + } }; return if (args.recursive) mkdirRecursive(this, args) else mkdirNonRecursive(this, args); } @@ -3927,9 +3932,9 @@ pub const NodeFS = struct { } pub fn mkdirRecursiveImpl(this: *NodeFS, args: Arguments.Mkdir, comptime Ctx: type, ctx: Ctx) Maybe(Return.Mkdir) { - const buf = bun.OSPathBufferPool.get(); - defer bun.OSPathBufferPool.put(buf); - const path = args.path.osPath(buf); + const buf = bun.PathBufferPool.get(); + defer bun.PathBufferPool.put(buf); + const path = args.path.osPathKernel32(buf); return switch (args.always_return_none) { inline else => |always_return_none| this.mkdirRecursiveOSPathImpl(Ctx, ctx, path, args.mode, !always_return_none),