fn filenameInRoot(filename: []const u8, root: []const u8) bool
returns true if filename starts with root followed by a forward slash
filename
root
filename: []const u8
root: []const u8
581 582 583 584 585
fn filenameInRoot(filename: []const u8, root: []const u8) bool { return (filename.len >= root.len + 1) and (filename[root.len] == '/') and std.mem.eql(u8, filename[0..root.len], root); }
returns true if
filenamestarts withrootfollowed by a forward slash