diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index 4d2c58cb326c8..a0411e7f5c3d4 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -134,9 +134,9 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(const QString &path, bool exclu { /* split up the path */ QStringView bname(path); - int lastSlash = path.lastIndexOf(QLatin1Char('/')); + int lastSlash = bname.lastIndexOf(QLatin1Char('/')); if (lastSlash >= 0) { - bname = path.mid(lastSlash + 1); + bname = bname.mid(lastSlash + 1); } qsizetype blen = bname.size();