| ... | ... | @@ -2917,8 +2917,9 @@ pub fn dirOpenFileWtf16( |
| 2917 | 2917 | sub_path_w: [:0]const u16, |
| 2918 | 2918 | flags: File.OpenFlags, |
| 2919 | 2919 | ) File.OpenError!File { |
| 2920 | | if (std.mem.eql(u16, sub_path_w, &.{'.'})) return error.IsDir; |
| 2921 | | if (std.mem.eql(u16, sub_path_w, &.{ '.', '.' })) return error.IsDir; |
| 2920 | const allow_directory = flags.allow_directory and !flags.isWrite(); |
| 2921 | if (!allow_directory and std.mem.eql(u16, sub_path_w, &.{'.'})) return error.IsDir; |
| 2922 | if (!allow_directory and std.mem.eql(u16, sub_path_w, &.{ '.', '.' })) return error.IsDir; |
| 2922 | 2923 | const path_len_bytes = std.math.cast(u16, sub_path_w.len * 2) orelse return error.NameTooLong; |
| 2923 | 2924 | const current_thread = Thread.getCurrent(t); |
| 2924 | 2925 | const w = windows; |
| ... | ... | @@ -2963,7 +2964,7 @@ pub fn dirOpenFileWtf16( |
| 2963 | 2964 | .OPEN, |
| 2964 | 2965 | .{ |
| 2965 | 2966 | .IO = if (flags.follow_symlinks) .SYNCHRONOUS_NONALERT else .ASYNCHRONOUS, |
| 2966 | | .NON_DIRECTORY_FILE = !flags.allow_directory, |
| 2967 | .NON_DIRECTORY_FILE = !allow_directory, |
| 2967 | 2968 | .OPEN_REPARSE_POINT = !flags.follow_symlinks, |
| 2968 | 2969 | }, |
| 2969 | 2970 | null, |