Skip to content

Commit f64f342

Browse files
vesim987andrewrk
authored andcommitted
std.tar: trim also spaces from the beginning of file size
1 parent 8ca4a52 commit f64f342

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/tar.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub const Header = struct {
8282

8383
pub fn fileSize(header: Header) !u64 {
8484
const raw = header.bytes[124..][0..12];
85-
const ltrimmed = std.mem.trimLeft(u8, raw, "0");
85+
const ltrimmed = std.mem.trimLeft(u8, raw, "0 ");
8686
const rtrimmed = std.mem.trimRight(u8, ltrimmed, " \x00");
8787
if (rtrimmed.len == 0) return 0;
8888
return std.fmt.parseInt(u64, rtrimmed, 8);

0 commit comments

Comments
 (0)