From: Claudio Cambra Date: Mon, 10 Jul 2023 09:22:14 +0000 (+0800) Subject: Fix trailing slash procedure in DiscoveryPhase::checkSelectiveSyncNewFolder X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~57^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ac8e9c427499d5e77212e8849df05788d0402cf4;p=nextcloud-desktop.git Fix trailing slash procedure in DiscoveryPhase::checkSelectiveSyncNewFolder Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 81aa34ea8..e992159a9 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -122,7 +122,8 @@ void DiscoveryPhase::checkSelectiveSyncNewFolder(const QString &path, } // it is not too big, put it in the white list (so we will not do more query for the children) and and do not block. - const auto sanitisedPath = path.endsWith(QLatin1Char('/')) ? path + QLatin1Char('/') : path; + static const auto slash = QLatin1Char('/'); + const auto sanitisedPath = path.endsWith(slash) ? path : path + slash; _selectiveSyncWhiteList.insert(std::upper_bound(_selectiveSyncWhiteList.begin(), _selectiveSyncWhiteList.end(), sanitisedPath), sanitisedPath); return callback(false); });