From 66d8b85463da60f0b88c3f7d6068df502d940546 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 4 Apr 2006 23:52:56 +0000 Subject: Allow symlinks to directories for FS;es with D_TYPE support. svn-id: r21616 --- backends/fs/posix/posix-fs.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'backends/fs/posix') diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index e63517d565..687a958e4a 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -146,7 +146,13 @@ FSList POSIXFilesystemNode::listDir(ListMode mode) const { entry._isDirectory = S_ISDIR(st.st_mode); #else entry._isValid = (dp->d_type == DT_DIR) || (dp->d_type == DT_REG) || (dp->d_type == DT_LNK); - entry._isDirectory = (dp->d_type == DT_DIR); + if (dp->d_type == DT_LNK) { + struct stat st; + stat(entry._path.c_str(), &st); + entry._isDirectory = S_ISDIR(st.st_mode); + } else { + entry._isDirectory = (dp->d_type == DT_DIR); + } #endif // Skip files that are invalid for some reason (e.g. because we couldn't -- cgit v1.2.3