diff --git a/changelog/unreleased/9030 b/changelog/unreleased/9030 new file mode 100644 index 00000000000..025dfd6545d --- /dev/null +++ b/changelog/unreleased/9030 @@ -0,0 +1,3 @@ +macOS: Do not strip trailing whitespace from a file or folder name + +https://github.com/owncloud/client/issues/9030 diff --git a/src/gui/socketapi/socketapi.cpp b/src/gui/socketapi/socketapi.cpp index 57367049f5b..f14d873b25a 100644 --- a/src/gui/socketapi/socketapi.cpp +++ b/src/gui/socketapi/socketapi.cpp @@ -341,7 +341,10 @@ void SocketApi::slotReadSocket() while (socket->canReadLine()) { // Make sure to normalize the input from the socket to // make sure that the path will match, especially on OS X. - const QString line = QString::fromUtf8(socket->readLine().trimmed()).normalized(QString::NormalizationForm_C); + QString line = QString::fromUtf8(socket->readLine()).normalized(QString::NormalizationForm_C); + // Note: do NOT use QString::trimmed() here! That will also remove any trailing spaces (which _are_ part of the filename)! + line.chop(1); // remove the '\n' + qCInfo(lcSocketApi) << "Received SocketAPI message <--" << line << "from" << socket; const int argPos = line.indexOf(QLatin1Char(':')); const QByteArray command = line.midRef(0, argPos).toUtf8().toUpper();