refactor(linux-user): use new Environ method

This commit is contained in:
utox39
2026-02-11 18:33:03 +01:00
parent 9764de5353
commit 51f6ddc2d1

View File

@@ -1,8 +1,7 @@
const std = @import("std"); const std = @import("std");
pub fn getUsername(allocator: std.mem.Allocator) ![]u8 { pub fn getUsername(allocator: std.mem.Allocator, environ: std.process.Environ) ![]u8 {
const username = try std.process.getEnvVarOwned(allocator, "USER"); return try std.process.Environ.getAlloc(environ, allocator, "USER");
return username;
} }
pub fn getShell(allocator: std.mem.Allocator) ![]u8 { pub fn getShell(allocator: std.mem.Allocator) ![]u8 {