summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2009-08-11 16:11:25 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 16:21:09 (GMT)
commit7fe0dfb80efd67886a33fe8b37e9714175925688 (patch)
treee68df9927da4b221ebadb76a2beb9883a281d2d3 /src/corelib
parent0e193b51c995395c92f8b1d0b67a782314772c6c (diff)
downloadQt-7fe0dfb80efd67886a33fe8b37e9714175925688.zip
Qt-7fe0dfb80efd67886a33fe8b37e9714175925688.tar.gz
Qt-7fe0dfb80efd67886a33fe8b37e9714175925688.tar.bz2
avoid crash when testing HiddenFlag and BaseName is empty
Merge-request: 1176 Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 029d422..4d451e6 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -656,7 +656,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
ret |= LocalDiskFlag;
if (exists)
ret |= ExistsFlag;
- if (fileName(BaseName)[0] == QLatin1Char('.')
+ QString baseName = fileName(BaseName);
+ if ((baseName.size() > 0 && baseName.at(0) == QLatin1Char('.'))
#if !defined(QWS) && defined(Q_OS_MAC)
|| _q_isMacHidden(d->filePath)
#endif