diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-12-01 09:12:31 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-12-01 09:12:31 (GMT) |
commit | ca7a80a29000f45fc1bd5b0c491abc2bc44b620f (patch) | |
tree | 14f34a2d8f8c8e46ac5bb4adc8e18b4345717b7a | |
parent | 700a069591d29733609e619c224861ca774bfb32 (diff) | |
download | Qt-ca7a80a29000f45fc1bd5b0c491abc2bc44b620f.zip Qt-ca7a80a29000f45fc1bd5b0c491abc2bc44b620f.tar.gz Qt-ca7a80a29000f45fc1bd5b0c491abc2bc44b620f.tar.bz2 |
Fix a crash in QFSFileEnginePrivate::canonicalized() on Mac OS X 10.5
The realpath() extension we use in this function is only available from
10.6 onwards. For the time being this optimization is turned off on Mac.
Reviewed-by: Markus Goetz
-rw-r--r-- | src/corelib/io/qfsfileengine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index b8f6e2c..2178fa9 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -138,12 +138,13 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) if (path.isEmpty()) return path; -#if defined(Q_OS_UNIX) || defined(Q_OS_SYMBIAN) // FIXME let's see if this stuff works, then we might be able to remove some of the other code. - // baaad Mac: 10.5 and 10.6 crash if trying to free a value returned by - // realpath() if the input path is just the root component. +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) if (path.size() == 1 && path.at(0) == QLatin1Char('/')) return path; +#endif + // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here. +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) char *ret = realpath(path.toLocal8Bit().constData(), (char*)0); if (ret) { QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); |