Commit 242102f9d1
Changed files (1)
lib
std
lib/std/zip.zig
@@ -536,9 +536,6 @@ pub const Iterator = struct {
@as(u64, local_header.extra_len);
};
- if (isBadFilename(filename))
- return error.ZipBadFilename;
-
if (options.allow_backslashes) {
std.mem.replaceScalar(u8, filename, '\\', '/');
} else {
@@ -546,6 +543,9 @@ pub const Iterator = struct {
return error.ZipFilenameHasBackslash;
}
+ if (isBadFilename(filename))
+ return error.ZipBadFilename;
+
// All entries that end in '/' are directories
if (filename[filename.len - 1] == '/') {
if (self.uncompressed_size != 0)