windowsspec.cpp: Fix wrong file attribute lookup
Regular files in Windows might not only include the _A_NORMAL attribute [1]. In fact, experiments with WINE revealed that most files would in fact include the _A_ARCH attribute. Otherwise, most files would default to FList::unknown and therefore functions relying on FList::file would not work. [1]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/filename-search-functions?view=msvc-170 Former-commit-id: 4fb5d0a07fe84b67ebe6541a7e0c9bc630579b42 Former-commit-id: 6dc6253ef0a737ab1c7881adc9b02088e7722243
This commit is contained in:
parent
ad907a7e64
commit
b288af7b3b
1 changed files with 3 additions and 5 deletions
|
@ -433,11 +433,9 @@ windowsDirGetList(const char *dir)
|
||||||
if ( strcmp(FData.name, ".") != 0 && strcmp(FData.name, "..") != 0 ) {
|
if ( strcmp(FData.name, ".") != 0 && strcmp(FData.name, "..") != 0 ) {
|
||||||
curf = (tFList*)calloc(1, sizeof(tFList));
|
curf = (tFList*)calloc(1, sizeof(tFList));
|
||||||
curf->name = strdup(FData.name);
|
curf->name = strdup(FData.name);
|
||||||
if (FData.attrib & _A_NORMAL) {
|
curf->type = FData.attrib & _A_SUBDIR ?
|
||||||
curf->type = FList::file;
|
FList::dir : FList::file;
|
||||||
} else if (FData.attrib & _A_SUBDIR) {
|
|
||||||
curf->type = FList::dir;
|
|
||||||
}
|
|
||||||
if (flist == (tFList*)NULL) {
|
if (flist == (tFList*)NULL) {
|
||||||
curf->next = curf;
|
curf->next = curf;
|
||||||
curf->prev = curf;
|
curf->prev = curf;
|
||||||
|
|
Loading…
Reference in a new issue