Fixed a couple stupid mistakes
This commit is contained in:
@@ -92,9 +92,6 @@ fn extractDir(
|
|||||||
path: []const u8,
|
path: []const u8,
|
||||||
options: ExtractionOptions,
|
options: ExtractionOptions,
|
||||||
) !void {
|
) !void {
|
||||||
std.debug.print("starting extract dir: {s}\n", .{path});
|
|
||||||
defer std.debug.print("end extract dir: {s}\n", .{path});
|
|
||||||
|
|
||||||
var xattr_idx: ?u32 = null;
|
var xattr_idx: ?u32 = null;
|
||||||
|
|
||||||
try Io.Dir.cwd().createDirPath(io, path);
|
try Io.Dir.cwd().createDirPath(io, path);
|
||||||
@@ -149,8 +146,6 @@ fn extractFile(
|
|||||||
path: []const u8,
|
path: []const u8,
|
||||||
options: ExtractionOptions,
|
options: ExtractionOptions,
|
||||||
) !void {
|
) !void {
|
||||||
std.debug.print("starting extract file: {s}\n", .{path});
|
|
||||||
defer std.debug.print("end extract file: {s}\n", .{path});
|
|
||||||
var xattr_idx: ?u32 = null;
|
var xattr_idx: ?u32 = null;
|
||||||
|
|
||||||
var rdr: DataReader = switch (inode.data) {
|
var rdr: DataReader = switch (inode.data) {
|
||||||
@@ -201,8 +196,6 @@ fn extractFile(
|
|||||||
try setMetadata(alloc, io, id_table, xattr_table, inode, path, options, xattr_idx);
|
try setMetadata(alloc, io, id_table, xattr_table, inode, path, options, xattr_idx);
|
||||||
}
|
}
|
||||||
fn extractSymlink(io: Io, inode: Inode, path: []const u8) !void {
|
fn extractSymlink(io: Io, inode: Inode, path: []const u8) !void {
|
||||||
std.debug.print("starting extract symlink: {s}\n", .{path});
|
|
||||||
defer std.debug.print("end extract symlink: {s}\n", .{path});
|
|
||||||
return switch (inode.data) {
|
return switch (inode.data) {
|
||||||
.symlink => |s| Io.Dir.cwd().symLink(io, s.target, path, .{}),
|
.symlink => |s| Io.Dir.cwd().symLink(io, s.target, path, .{}),
|
||||||
.ext_symlink => |s| Io.Dir.cwd().symLink(io, s.target, path, .{}),
|
.ext_symlink => |s| Io.Dir.cwd().symLink(io, s.target, path, .{}),
|
||||||
@@ -218,8 +211,6 @@ fn extractNod(
|
|||||||
path: []const u8,
|
path: []const u8,
|
||||||
options: ExtractionOptions,
|
options: ExtractionOptions,
|
||||||
) !void {
|
) !void {
|
||||||
std.debug.print("starting extract nod: {s}\n", .{path});
|
|
||||||
defer std.debug.print("end extract nod: {s}\n", .{path});
|
|
||||||
var dev: u32 = 0;
|
var dev: u32 = 0;
|
||||||
var mode: u32 = undefined;
|
var mode: u32 = undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ fn readVec(r: *Reader, vec: [][]u8) Reader.Error!usize {
|
|||||||
@memcpy(v[0..to_cpy], r.buffer[r.seek..][0..to_cpy]);
|
@memcpy(v[0..to_cpy], r.buffer[r.seek..][0..to_cpy]);
|
||||||
|
|
||||||
wrote += to_cpy;
|
wrote += to_cpy;
|
||||||
|
r.seek += to_cpy;
|
||||||
|
|
||||||
if (r.seek >= r.end) break;
|
if (r.seek >= r.end) break;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -67,7 +67,7 @@ test "ExtractCompleteArchiveSingleThreadedOption" {
|
|||||||
const io = testing.io;
|
const io = testing.io;
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
|
|
||||||
Io.Dir.cwd().deleteFile(io, TestFullExtractLocationSTOption) catch {};
|
Io.Dir.cwd().deleteTree(io, TestFullExtractLocationSTOption) catch {};
|
||||||
|
|
||||||
var archive_file = try Io.Dir.cwd().openFile(io, TestArchive, .{});
|
var archive_file = try Io.Dir.cwd().openFile(io, TestArchive, .{});
|
||||||
defer archive_file.close(io);
|
defer archive_file.close(io);
|
||||||
@@ -84,7 +84,7 @@ test "ExtractCompleteArchiveMultiThreaded" {
|
|||||||
const io = testing.io;
|
const io = testing.io;
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
|
|
||||||
Io.Dir.cwd().deleteFile(io, TestFullExtractLocationMT) catch {};
|
Io.Dir.cwd().deleteTree(io, TestFullExtractLocationMT) catch {};
|
||||||
|
|
||||||
var archive_file = try Io.Dir.cwd().openFile(io, TestArchive, .{});
|
var archive_file = try Io.Dir.cwd().openFile(io, TestArchive, .{});
|
||||||
defer archive_file.close(io);
|
defer archive_file.close(io);
|
||||||
|
|||||||
Reference in New Issue
Block a user