authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-03-17 09:06:54+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-03-17 09:06:54+02:00
loge6f74b78ef48bc1d23ccd98d042534f0bbe3eb80
tree6016314cc6920336bb62062e7423313bd380b24f
parentec2465542cd7bfd58f7bf72552b6f332af2c03f9

std: define error set of `toPosixPath`


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

lib/std/dynamic_library.zig+1-1
......@@ -414,7 +414,7 @@ pub const WindowsDynLib = struct {
414414};
415415
416416pub const DlDynLib = struct {
417 pub const Error = error{FileNotFound};
417 pub const Error = error{ FileNotFound, NameTooLong };
418418
419419 handle: *anyopaque,
420420
lib/std/os.zig+1-1
......@@ -5979,7 +5979,7 @@ pub fn sched_getaffinity(pid: pid_t) SchedGetAffinityError!cpu_set_t {
59795979
59805980/// Used to convert a slice to a null terminated slice on the stack.
59815981/// TODO https://github.com/ziglang/zig/issues/287
5982pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 {
5982pub fn toPosixPath(file_path: []const u8) error{NameTooLong}![MAX_PATH_BYTES - 1:0]u8 {
59835983 if (std.debug.runtime_safety) assert(std.mem.indexOfScalar(u8, file_path, 0) == null);
59845984 var path_with_null: [MAX_PATH_BYTES - 1:0]u8 = undefined;
59855985 // >= rather than > to make room for the null byte