Skip to content

Commit e7b8772

Browse files
committed
oh nuhhhh
1 parent 5d95575 commit e7b8772

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,12 @@ fn exec(allocator: std.mem.Allocator, zig_binary: []const u8, args: [][:0]u8) !s
108108

109109
// if user is in /home/john/dummy/x and there is a entry for /home/john/dummy/ in the config file,
110110
// then return the version for /home/john/dummy/
111-
fn recursiveW(absolute_: []const u8, cfg: *std.StringHashMap([]const u8)) !?[]const u8 {
112-
var absolute = absolute_;
111+
fn recursiveW(starter: []const u8, cfg: *std.StringHashMap([]const u8)) !?[]const u8 {
112+
var absolute = starter;
113113

114114
while (true) {
115-
if (cfg.contains(absolute)) {
116-
return cfg.get(absolute) orelse unreachable;
117-
}
115+
if (cfg.get(absolute)) |a|
116+
return a;
118117

119118
if (std.mem.lastIndexOfScalar(u8, absolute, '/')) |l|
120119
absolute = absolute[0..l]

0 commit comments

Comments
 (0)