From 2bb926742f68de204d95a1044fe6af577b59f174 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 24 Aug 2015 16:55:05 -0300 Subject: [PATCH] See symlinks to folder as folders (fix #524) --- src/app/file_system.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/file_system.cpp b/src/app/file_system.cpp index 5a4661aa4..5fcb4cf50 100644 --- a/src/app/file_system.cpp +++ b/src/app/file_system.cpp @@ -461,9 +461,17 @@ const FileItemList& FileItem::getChildren() if (!child) { child = new FileItem(this); + bool is_folder; + if (entry->d_type == DT_LNK) { + is_folder = base::is_directory(fullfn); + } + else { + is_folder = (entry->d_type == DT_DIR); + } + child->filename = fullfn; child->displayname = fn; - child->is_folder = (entry->d_type == DT_DIR); + child->is_folder = is_folder; put_fileitem(child); } @@ -898,7 +906,7 @@ static void put_fileitem(FileItem* fileitem) #else ////////////////////////////////////////////////////////////////////// -// Allegro for_each_file: Portable +// POSIX functions ////////////////////////////////////////////////////////////////////// static FileItem* get_fileitem_by_path(const std::string& path, bool create_if_not)