kdecore: return empty string if there is no slash in the input of kPathDirectory()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-26 21:52:43 +03:00
parent 4f1050a5ac
commit bd990c2ae8

View file

@ -61,7 +61,7 @@ static QString kPathDirectory(const QString &path)
{
const int lastslash = path.lastIndexOf(QLatin1Char('/'));
if (lastslash == -1) {
return QString(QLatin1Char('.'));
return QString();
}
if (lastslash == 0) {
return QString(QLatin1Char('/'));