Changeset 178 for trunk/src/corelib/io
- Timestamp:
- Sep 11, 2009, 2:30:36 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qfsfileengine_iterator_os2.cpp
r21 r178 121 121 if (!platform->done && !platform->dir) { 122 122 QFSFileEngineIterator *that = const_cast<QFSFileEngineIterator *>(this); 123 if ((that->platform->dir = ::opendir(QFile::encodeName(path()).data())) == 0) { 123 QString path = that->path(); 124 // ensure the directory ends with a slash, otherwise for paths like 'X:' 125 // we'll get the current directory's listing instead of the expected root 126 if (!path.endsWith(QLatin1Char('/'))) 127 path.append(QLatin1Char('/')); 128 if ((that->platform->dir = ::opendir(QFile::encodeName(path).data())) == 0) { 124 129 that->platform->done = true; 125 130 } else { 126 131 // ### Race condition; we should use fpathconf and dirfd(). 127 long maxPathName = ::pathconf(QFile::encodeName(path ()).data(), _PC_NAME_MAX);132 long maxPathName = ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX); 128 133 if ((int) maxPathName == -1) 129 134 maxPathName = FILENAME_MAX;
Note:
See TracChangeset
for help on using the changeset viewer.