| ... | @@ -399,7 +399,14 @@ pub const Dir = struct { | ... | @@ -399,7 +399,14 @@ pub const Dir = struct { |
| 399 | | 399 | |
| 400 | const name = @ptrCast([*]u8, &bsd_entry.d_name)[0..bsd_entry.d_namlen]; | 400 | const name = @ptrCast([*]u8, &bsd_entry.d_name)[0..bsd_entry.d_namlen]; |
| 401 | | 401 | |
| 402 | if (mem.eql(u8, name, ".") or mem.eql(u8, name, "..")) { | 402 | const skip_zero_fileno = switch (builtin.os.tag) { |
| | 403 | // d_fileno=0 is used to mark invalid entries or deleted files. |
| | 404 | .openbsd, .netbsd => true, |
| | 405 | else => false, |
| | 406 | }; |
| | 407 | if (mem.eql(u8, name, ".") or mem.eql(u8, name, "..") or |
| | 408 | (skip_zero_fileno and bsd_entry.d_fileno == 0)) |
| | 409 | { |
| 403 | continue :start_over; | 410 | continue :start_over; |
| 404 | } | 411 | } |
| 405 | | 412 | |