From 49d3bb005889b9fb5a06d6aadac23ebd5b2f9f2d Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 6 Oct 2016 11:24:38 +0200 Subject: Normalize realpath(3) output to composed form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All strings coming out of POSIX API calls are converted to composed form by QFile::decodeName. Do the same for realpath(3) output. This is especially important for HFS+, which will store file names in decomposed form, and APIs will therefore return strings in decomposed form. Task-number: QTBUG-55896 Change-Id: I5e51f4e5712ff26bf9644cbcf9a9603995748892 Reviewed-by: Morten Johan Sørvig --- src/corelib/io/qfilesystemengine_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qfilesystemengine_unix.cpp') diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 7bc2293b0d..3cc27bf847 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -276,7 +276,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, if (ret) { data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; data.entryFlags |= QFileSystemMetaData::ExistsAttribute; - QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); + QString canonicalPath = QDir::cleanPath(QFile::decodeName(ret)); free(ret); return QFileSystemEntry(canonicalPath); } else if (errno == ENOENT) { // file doesn't exist -- cgit v1.2.3