OSDN Git Service

fix QDir::absoluteFilePath() regression
authorIvailo Monev <xakepa10@gmail.com>
Tue, 1 Nov 2022 02:14:37 +0000 (04:14 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 1 Nov 2022 02:14:37 +0000 (04:14 +0200)
somewhere in the abstraction engine it was returned clean

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/io/qdir.cpp

index 8b4e7d1..81545c0 100644 (file)
@@ -602,7 +602,7 @@ QString QDir::absoluteFilePath(const QString &fileName) const
     d->resolveAbsoluteEntry();
     if (fileName.isEmpty())
         return d->absoluteDirEntry.filePath();
-    if (!d->absoluteDirEntry.isRoot())
+    if (!d->absoluteDirEntry.filePath().endsWith(QLatin1Char('/')))
         return d->absoluteDirEntry.filePath() + QLatin1Char('/') + fileName;
     return d->absoluteDirEntry.filePath() + fileName;
 }