Commit 7b1df689 authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

Bug fixes for _NO_EXTENSIONS mode.

parent 97bc8f6d
...@@ -317,6 +317,15 @@ static void read_directory_win(Entry* dir, LPCTSTR path) ...@@ -317,6 +317,15 @@ static void read_directory_win(Entry* dir, LPCTSTR path)
if (hFind != INVALID_HANDLE_VALUE) { if (hFind != INVALID_HANDLE_VALUE) {
do { do {
#ifdef _NO_EXTENSIONS
/* hide directory entry "." */
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
LPCTSTR name = w32fd.cFileName;
if (name[0]=='.' && name[1]=='\0')
continue;
}
#endif
entry = alloc_entry(); entry = alloc_entry();
if (!first_entry) if (!first_entry)
...@@ -332,15 +341,7 @@ static void read_directory_win(Entry* dir, LPCTSTR path) ...@@ -332,15 +341,7 @@ static void read_directory_win(Entry* dir, LPCTSTR path)
entry->scanned = FALSE; entry->scanned = FALSE;
entry->level = level; entry->level = level;
#ifdef _NO_EXTENSIONS #ifndef _NO_EXTENSIONS
/* hide directory entry "." */
if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
LPCTSTR name = entry->data.cFileName;
if (name[0]=='.' && name[1]=='\0')
continue;
}
#else
entry->etype = ET_WINDOWS; entry->etype = ET_WINDOWS;
entry->bhfi_valid = FALSE; entry->bhfi_valid = FALSE;
...@@ -358,9 +359,10 @@ static void read_directory_win(Entry* dir, LPCTSTR path) ...@@ -358,9 +359,10 @@ static void read_directory_win(Entry* dir, LPCTSTR path)
#endif #endif
last = entry; last = entry;
} while(FindNextFile(hFind, &entry->data)); } while(FindNextFile(hFind, &w32fd));
last->next = NULL; if (last)
last->next = NULL;
FindClose(hFind); FindClose(hFind);
} }
...@@ -526,7 +528,8 @@ static void read_directory_unix(Entry* dir, LPCTSTR path) ...@@ -526,7 +528,8 @@ static void read_directory_unix(Entry* dir, LPCTSTR path)
last = entry; last = entry;
} }
last->next = NULL; if (last)
last->next = NULL;
closedir(pdir); closedir(pdir);
} }
...@@ -3335,7 +3338,9 @@ static void refresh_child(ChildWnd* child) ...@@ -3335,7 +3338,9 @@ static void refresh_child(ChildWnd* child)
static void create_drive_bar() static void create_drive_bar()
{ {
TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}; TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
#ifndef _NO_EXTENSIONS
TCHAR b1[BUFFER_LEN]; TCHAR b1[BUFFER_LEN];
#endif
int btn = 1; int btn = 1;
PTSTR p; PTSTR p;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <commctrl.h> #include <commctrl.h>
#include <commdlg.h> #include <commdlg.h>
#include <shellapi.h> #include <shellapi.h>
#include <shlobj.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <tchar.h> #include <tchar.h>
...@@ -102,9 +103,6 @@ enum IMAGE { ...@@ -102,9 +103,6 @@ enum IMAGE {
#ifndef _NO_EXTENSIONS #ifndef _NO_EXTENSIONS
#define _SHELL_FOLDERS #define _SHELL_FOLDERS
#include <objbase.h>
#include <shlobj.h>
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment