aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/posix
diff options
context:
space:
mode:
authorEugene Sandulenko2006-04-04 23:52:56 +0000
committerEugene Sandulenko2006-04-04 23:52:56 +0000
commit66d8b85463da60f0b88c3f7d6068df502d940546 (patch)
treea492e62ee9637a81cf54e7d5ebab930a9bac6980 /backends/fs/posix
parent004a39b3af8cb8ac1725fcea66ea45862419e49d (diff)
downloadscummvm-rg350-66d8b85463da60f0b88c3f7d6068df502d940546.tar.gz
scummvm-rg350-66d8b85463da60f0b88c3f7d6068df502d940546.tar.bz2
scummvm-rg350-66d8b85463da60f0b88c3f7d6068df502d940546.zip
Allow symlinks to directories for FS;es with D_TYPE support.
svn-id: r21616
Diffstat (limited to 'backends/fs/posix')
-rw-r--r--backends/fs/posix/posix-fs.cpp8
1 files changed, 7 insertions, 1 deletions
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