DoxigAlpha

isBadFilename

Function parameters

Parameters

#
filename:[]const u8

Type definitions in this namespace

Types

#

Extract the zipped files to the given `dest` directory.

Functions

#
extract
Extract the zipped files to the given `dest` directory.

= [4]u8{ 'P', 'K', 1, 2 }

Values

#
central_file_header_sig
= [4]u8{ 'P', 'K', 1, 2 }
local_file_header_sig
= [4]u8{ 'P', 'K', 3, 4 }
end_record_sig
= [4]u8{ 'P', 'K', 5, 6 }
end_record64_sig
= [4]u8{ 'P', 'K', 6, 6 }
end_locator64_sig
= [4]u8{ 'P', 'K', 6, 7 }

Source

Implementation

#
fn isBadFilename(filename: []const u8) bool {
    if (filename.len == 0 or filename[0] == '/')
        return true;

    var it = std.mem.splitScalar(u8, filename, '/');
    while (it.next()) |part| {
        if (std.mem.eql(u8, part, ".."))
            return true;
    }

    return false;
}