diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2013-01-03 15:50:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-23 10:38:50 +0100 |
commit | cd5a4279f38ac6cca8ff8da4d75c2577d9b0bbcd (patch) | |
tree | 4c581d305c2d1b4b5b1810b4260ef45b05b54182 /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | 608cd1ad84484448ac9b0b8b4d88e0e8ff4a9cf1 (diff) |
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: I9d2829e32431c2d50fefe55c93780cd37165e565
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-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 fa0e07b045..03a682a234 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -685,8 +685,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("QFileSystemEngine::currentPath: getcwd() failed"); |