diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp --- a/src/core/mkpathjob.cpp +++ b/src/core/mkpathjob.cpp @@ -44,7 +44,11 @@ int i = 0; for (; i < basePathComponents.count() && i < m_pathComponents.count(); ++i) { if (m_pathComponents.at(i) == basePathComponents.at(i)) { - m_url.setPath(m_url.path() + '/' + m_pathComponents.at(i)); + if (m_url.path() == QLatin1Char('/')) { + m_url.setPath(m_url.path() + m_pathComponents.at(i)); + } else { + m_url.setPath(m_url.path() + '/' + m_pathComponents.at(i)); + } } else { break; } @@ -57,7 +61,12 @@ if (m_url.isLocalFile()) { i = 0; for (; i < m_pathComponents.count(); ++i) { - QString testDir = m_url.toLocalFile() + '/' + m_pathComponents.at(i); + QString testDir; + if (m_url.toLocalFile() == QLatin1Char('/')) { + testDir = m_url.toLocalFile() + m_pathComponents.at(i); + } else { + testDir = m_url.toLocalFile() + '/' + m_pathComponents.at(i); + } if (QFileInfo(testDir).isDir()) { m_url.setPath(testDir); } else {