diff --git a/src/linux/user.zig b/src/linux/user.zig index 0b9971b..9f92373 100644 --- a/src/linux/user.zig +++ b/src/linux/user.zig @@ -23,7 +23,7 @@ pub fn getShell(allocator: std.mem.Allocator) ![]u8 { _ = try child.wait(); if (std.mem.indexOf(u8, shell, "bash") != null) { - const bash_version = parseBashVersion(allocator, output); + const bash_version = parseBashVersion(output); defer allocator.free(output); return try std.fmt.allocPrint(allocator, "{s} {s}", .{ "bash", bash_version.? }); } @@ -31,8 +31,7 @@ pub fn getShell(allocator: std.mem.Allocator) ![]u8 { return output; } -fn parseBashVersion(allocator: std.mem.Allocator, shell_version_output: []u8) ?[]u8 { - _ = allocator; +fn parseBashVersion(shell_version_output: []u8) ?[]u8 { const end_index = std.mem.indexOf(u8, shell_version_output, "("); if (end_index == null) return null; diff --git a/src/macos/user.zig b/src/macos/user.zig index 170ea84..e188a5d 100644 --- a/src/macos/user.zig +++ b/src/macos/user.zig @@ -26,7 +26,7 @@ pub fn getShell(allocator: std.mem.Allocator) ![]u8 { _ = try child.wait(); if (std.mem.indexOf(u8, shell, "bash") != null) { - const bash_version = parseBashVersion(allocator, output); + const bash_version = parseBashVersion(output); defer allocator.free(output); return try std.fmt.allocPrint(allocator, "{s} {s}", .{ "bash", bash_version.? }); } @@ -34,8 +34,7 @@ pub fn getShell(allocator: std.mem.Allocator) ![]u8 { return output; } -fn parseBashVersion(allocator: std.mem.Allocator, shell_version_output: []u8) ?[]u8 { - _ = allocator; +fn parseBashVersion(shell_version_output: []u8) ?[]u8 { const end_index = std.mem.indexOf(u8, shell_version_output, "("); if (end_index == null) return null;