Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

normalizePathAlloc

Make a file system path identical independently of operating system path inconsistencies. This converts backslashes into forward slashes.

Fetch.normalizePathAlloc
fn normalizePathAlloc(arena: Allocator, pkg_path: []const u8) ![]const u8

File

lib/compiler/Maker/Fetch.zig:1991

Code

fn normalizePathAlloc(arena: Allocator, pkg_path: []const u8) ![]const u8 {
    const normalized = try arena.dupe(u8, pkg_path);
    if (fs.path.sep == canonical_sep) return normalized;
    normalizePath(normalized);
    return normalized;
}