mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Fix issues for latest GCC toolchain
This commit is contained in:
parent
5cb9b2658c
commit
3b086af91b
22 changed files with 148 additions and 166 deletions
|
@ -24,20 +24,13 @@
|
|||
#include "libc/str/str.h"
|
||||
|
||||
static textwindows bool SubpathExistsThatsNotDirectory(char16_t *path) {
|
||||
int e;
|
||||
char16_t *p;
|
||||
uint32_t attrs;
|
||||
e = errno;
|
||||
while ((p = strrchr16(path, '\\'))) {
|
||||
*p = u'\0';
|
||||
if ((attrs = GetFileAttributes(path)) != -1u) {
|
||||
if (attrs & kNtFileAttributeDirectory) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
errno = e;
|
||||
if ((attrs = GetFileAttributes(path)) != -1u &&
|
||||
!(attrs & kNtFileAttributeDirectory)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue