| ... | ... | @@ -35,7 +35,7 @@ pub const Header = struct { |
| 35 | 35 | pub fn fileSize(header: Header) !u64 { |
| 36 | 36 | const raw = header.bytes[124..][0..12]; |
| 37 | 37 | const ltrimmed = std.mem.trimLeft(u8, raw, "0"); |
| 38 | | const rtrimmed = std.mem.trimRight(u8, ltrimmed, "\x00"); |
| 38 | const rtrimmed = std.mem.trimRight(u8, ltrimmed, " \x00"); |
| 39 | 39 | if (rtrimmed.len == 0) return 0; |
| 40 | 40 | return std.fmt.parseInt(u64, rtrimmed, 8); |
| 41 | 41 | } |
| ... | ... | @@ -122,13 +122,16 @@ pub fn pipeToFileSystem(dir: std.fs.Dir, reader: anytype, options: Options) !voi |
| 122 | 122 | .directory => { |
| 123 | 123 | const file_name = try stripComponents(unstripped_file_name, options.strip_components); |
| 124 | 124 | if (file_name.len != 0) { |
| 125 | | try dir.makeDir(file_name); |
| 125 | try dir.makePath(file_name); |
| 126 | 126 | } |
| 127 | 127 | }, |
| 128 | 128 | .normal => { |
| 129 | 129 | if (file_size == 0 and unstripped_file_name.len == 0) return; |
| 130 | 130 | const file_name = try stripComponents(unstripped_file_name, options.strip_components); |
| 131 | 131 | |
| 132 | if (std.fs.path.dirname(file_name)) |dir_name| { |
| 133 | try dir.makePath(dir_name); |
| 134 | } |
| 132 | 135 | var file = try dir.createFile(file_name, .{}); |
| 133 | 136 | defer file.close(); |
| 134 | 137 | |