diff options
author | David Corrales | 2007-06-20 00:28:04 +0000 |
---|---|---|
committer | David Corrales | 2007-06-20 00:28:04 +0000 |
commit | 0ac96302fe9c04df79cb01a77d19535b45fe2db0 (patch) | |
tree | 96b84feb1a1a97cf597eace6d01c1519f69d46d4 /backends | |
parent | 8ebf479bc5db8cf4996cc0820269aaf04139b940 (diff) | |
download | scummvm-rg350-0ac96302fe9c04df79cb01a77d19535b45fe2db0.tar.gz scummvm-rg350-0ac96302fe9c04df79cb01a77d19535b45fe2db0.tar.bz2 scummvm-rg350-0ac96302fe9c04df79cb01a77d19535b45fe2db0.zip |
Initial implementation of the lookupFile() function. It's meant to search recursively for given
filename within a set of directories.
svn-id: r27551
Diffstat (limited to 'backends')
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index c976830402..385bab833c 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -174,8 +174,13 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo // loop over dir entries using readdir while ((dp = readdir(dirp)) != NULL) { // Skip 'invisible' files if necessary - if (dp->d_name[0] == '.' && !hidden) + if (dp->d_name[0] == '.' && !hidden) { continue; + } + // Skip '.' and '..' to avoid cycles + if((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) { + continue; + } String newPath(_path); if (newPath.lastChar() != '/') |