Fix some additional Windows TTY issues

This commit is contained in:
Justine Tunney 2023-10-03 23:53:59 -07:00
parent f26a280cda
commit 1694edf85c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 107 additions and 43 deletions

View file

@ -53,16 +53,6 @@ static textwindows int64_t sys_open_nt_impl(int dirfd, const char *path,
return kNtInvalidHandleValue;
}
// strip trailing slash
size_t n = strlen16(path16);
if (n > 1 && path16[n - 1] == '\\') {
// path denormalization only goes so far. when a trailing / or /.
// exists the kernel interprets that as having O_DIRECTORY intent
// furthermore, windows will throw an error on unc paths with it!
flags |= O_DIRECTORY;
path16[--n] = 0;
}
// implement no follow flag
// you can't open symlinks; use readlink
// this flag only applies to the final path component