From c39fe009af26d8795c5867809854a0aeeab2cc42 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Mon, 28 Nov 2022 22:18:34 +0100 Subject: [PATCH] std.fs.MAX_NAME_BYTES: fix MAXNAMLEN access --- lib/std/fs.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index 8dfd8119302d..72c02ed83db6 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -57,7 +57,7 @@ pub const MAX_NAME_BYTES = switch (builtin.os.tag) { .linux, .macos, .ios, .freebsd, .dragonfly => os.NAME_MAX, // Haiku's NAME_MAX includes the null terminator, so subtract one. .haiku => os.NAME_MAX - 1, - .netbsd, .openbsd, .solaris => os.MAXNAMLEN, + .netbsd, .openbsd, .solaris => os.system.MAXNAMLEN, // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. // If it would require 4 UTF-8 bytes, then there would be a surrogate // pair in the UTF-16LE, and we (over)account 3 bytes for it that way.