diff --git a/src/libs/tgf/windowsspec.cpp b/src/libs/tgf/windowsspec.cpp index 436859d7c..6dd58ef76 100644 --- a/src/libs/tgf/windowsspec.cpp +++ b/src/libs/tgf/windowsspec.cpp @@ -433,11 +433,9 @@ windowsDirGetList(const char *dir) if ( strcmp(FData.name, ".") != 0 && strcmp(FData.name, "..") != 0 ) { curf = (tFList*)calloc(1, sizeof(tFList)); curf->name = strdup(FData.name); - if (FData.attrib & _A_NORMAL) { - curf->type = FList::file; - } else if (FData.attrib & _A_SUBDIR) { - curf->type = FList::dir; - } + curf->type = FData.attrib & _A_SUBDIR ? + FList::dir : FList::file; + if (flist == (tFList*)NULL) { curf->next = curf; curf->prev = curf;