| ... | @@ -276,9 +276,7 @@ pub fn posixExecve(exe_path: []const u8, argv: []const []const u8, env_map: &con | ... | @@ -276,9 +276,7 @@ pub fn posixExecve(exe_path: []const u8, argv: []const []const u8, env_map: &con |
| 276 | { | 276 | { |
| 277 | var it = env_map.iterator(); | 277 | var it = env_map.iterator(); |
| 278 | var i: usize = 0; | 278 | var i: usize = 0; |
| 279 | while (true) : (i += 1) { | 279 | while (it.next()) |pair| : (i += 1) { |
| 280 | const pair = it.next() ?? break; | | |
| 281 | | | |
| 282 | const env_buf = %return allocator.alloc(u8, pair.key.len + pair.value.len + 2); | 280 | const env_buf = %return allocator.alloc(u8, pair.key.len + pair.value.len + 2); |
| 283 | @memcpy(&env_buf[0], pair.key.ptr, pair.key.len); | 281 | @memcpy(&env_buf[0], pair.key.ptr, pair.key.len); |
| 284 | env_buf[pair.key.len] = '='; | 282 | env_buf[pair.key.len] = '='; |
| ... | @@ -310,8 +308,7 @@ pub fn posixExecve(exe_path: []const u8, argv: []const []const u8, env_map: &con | ... | @@ -310,8 +308,7 @@ pub fn posixExecve(exe_path: []const u8, argv: []const []const u8, env_map: &con |
| 310 | var it = mem.split(PATH, ':'); | 308 | var it = mem.split(PATH, ':'); |
| 311 | var seen_eacces = false; | 309 | var seen_eacces = false; |
| 312 | var err: usize = undefined; | 310 | var err: usize = undefined; |
| 313 | while (true) { | 311 | while (it.next()) |search_path| { |
| 314 | const search_path = it.next() ?? break; | | |
| 315 | mem.copy(u8, path_buf, search_path); | 312 | mem.copy(u8, path_buf, search_path); |
| 316 | path_buf[search_path.len] = '/'; | 313 | path_buf[search_path.len] = '/'; |
| 317 | mem.copy(u8, path_buf[search_path.len + 1 ...], exe_path); | 314 | mem.copy(u8, path_buf[search_path.len + 1 ...], exe_path); |
| ... | @@ -689,9 +686,7 @@ start_over: | ... | @@ -689,9 +686,7 @@ start_over: |
| 689 | var full_entry_buf = List(u8).init(allocator); | 686 | var full_entry_buf = List(u8).init(allocator); |
| 690 | defer full_entry_buf.deinit(); | 687 | defer full_entry_buf.deinit(); |
| 691 | | 688 | |
| 692 | while (true) { | 689 | while (%return dir.next()) |entry| { |
| 693 | const entry = (%return dir.next()) ?? break; | | |
| 694 | | | |
| 695 | %return full_entry_buf.resize(full_path.len + entry.name.len + 1); | 690 | %return full_entry_buf.resize(full_path.len + entry.name.len + 1); |
| 696 | const full_entry_path = full_entry_buf.toSlice(); | 691 | const full_entry_path = full_entry_buf.toSlice(); |
| 697 | mem.copy(u8, full_entry_path, full_path); | 692 | mem.copy(u8, full_entry_path, full_path); |