diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2013-02-11 12:27:01 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-13 10:00:28 (GMT) |
commit | e9987783a170cc478b17be1f544fe67f1ac745a2 (patch) | |
tree | 74278c3408ceb20c818f0a1dfb6b0bc206a8f278 | |
parent | 640c1d0c18025fc81cbf4f4a0ba67f1f5acf9884 (diff) | |
download | Qt-e9987783a170cc478b17be1f544fe67f1ac745a2.zip Qt-e9987783a170cc478b17be1f544fe67f1ac745a2.tar.gz Qt-e9987783a170cc478b17be1f544fe67f1ac745a2.tar.bz2 |
Strip prepending <hostname>: string from currentPath() for VxSim
VxWorks simulator (VxSim) maps SDK rootdir usable as normal directory.
Mapped directory name is either host: or <hostname>: and can be used
without prepending prefix containing colon. Strip prepending string and
colon to get valid native path to host SDK rootdir running VxSim.
Change-Id: I15f4bf4d9eb2cea87268bad9b1a95973962cb2c8
(cherry picked from qtbase/cd5a4279f38ac6cca8ff8da4d75c2577d9b0bbcd)
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index b4e64e9..0c84a0f 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -675,8 +675,16 @@ QFileSystemEntry QFileSystemEngine::currentPath() } #else char currentName[PATH_MAX+1]; - if (::getcwd(currentName, PATH_MAX)) + if (::getcwd(currentName, PATH_MAX)) { +#if defined(Q_OS_VXWORKS) && defined(VXWORKS_VXSIM) + QByteArray dir(currentName); + if (dir.indexOf(':') < dir.indexOf('/')) + dir.remove(0, dir.indexOf(':')+1); + + qstrncpy(currentName, dir.constData(), PATH_MAX); +#endif result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath()); + } # if defined(QT_DEBUG) if (result.isEmpty()) qWarning("QFSFileEngine::currentPath: getcwd() failed"); |