1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-03-13 05:41:17 +00:00

Fix wrong parent path

This commit is contained in:
Chocobo1 2022-08-13 12:32:07 +08:00
parent 16482c507b
commit d7d1a90de6
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

@ -162,8 +162,8 @@ Path Path::parentPath() const
#ifdef Q_OS_WIN
// should be `c:/` instead of `c:`
// Windows "drive letter" is limited to one alphabet
if ((slashIndex == 2) && (m_pathStr.at(1) == u':'))
return createUnchecked(m_pathStr.left(slashIndex + 1));
if ((slashIndex == 2) && hasDriveLetter(m_pathStr))
return (m_pathStr.size() == 3) ? Path() : createUnchecked(m_pathStr.left(slashIndex + 1));
#endif
return createUnchecked(m_pathStr.left(slashIndex));
}