From 9764de5353c760094fed3c1a338edcaac07b2a58 Mon Sep 17 00:00:00 2001 From: utox39 Date: Wed, 11 Feb 2026 15:45:24 +0100 Subject: [PATCH] refactor(config): use new Environ method --- src/macos/user.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/macos/user.zig b/src/macos/user.zig index 475dedb..216e769 100644 --- a/src/macos/user.zig +++ b/src/macos/user.zig @@ -3,9 +3,8 @@ const std = @import("std"); /// Returns the current logged-in user's username. /// Uses the environment variable `USER`. /// The caller is responsible for freeing the allocated memory. -pub fn getUsername(allocator: std.mem.Allocator) ![]u8 { - const username = try std.process.getEnvVarOwned(allocator, "USER"); - return username; +pub fn getUsername(allocator: std.mem.Allocator, environ: std.process.Environ) ![]u8 { + return try std.process.Environ.getAlloc(environ, allocator, "USER"); } pub fn getShell(allocator: std.mem.Allocator) ![]u8 {