authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-10-13 23:24:23-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-10-29 14:30:45-07:00
logdd0962d5ea62742de50c62065856580d340e6cab
tree6e7ac70bfc1da5e1453e375b98037026d1fca6ff
parentc6ff1a71601f42dab5c8607397b28b34085134d8

Add wasi branch to MAX_NAME_BYTES


1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/fs.zig+2
...@@ -59,6 +59,8 @@ pub const MAX_NAME_BYTES = switch (builtin.os.tag) {...@@ -59,6 +59,8 @@ pub const MAX_NAME_BYTES = switch (builtin.os.tag) {
59 // If it would require 4 UTF-8 bytes, then there would be a surrogate59 // If it would require 4 UTF-8 bytes, then there would be a surrogate
60 // pair in the UTF-16LE, and we (over)account 3 bytes for it that way.60 // pair in the UTF-16LE, and we (over)account 3 bytes for it that way.
61 .windows => os.windows.NAME_MAX * 3,61 .windows => os.windows.NAME_MAX * 3,
62 // TODO work out what a reasonable value we should use here
63 .wasi => 1024,
62 else => if (@hasDecl(root, "os") and @hasDecl(root.os, "NAME_MAX"))64 else => if (@hasDecl(root, "os") and @hasDecl(root.os, "NAME_MAX"))
63 root.os.NAME_MAX65 root.os.NAME_MAX
64 else66 else