Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog/unreleased/90304
-rw-r--r--src/gui/socketapi/socketapi.cpp5
2 files changed, 8 insertions, 1 deletions
diff --git a/changelog/unreleased/9030 b/changelog/unreleased/9030
new file mode 100644
index 000000000..9a94738e1
--- /dev/null
+++ b/changelog/unreleased/9030
@@ -0,0 +1,4 @@
+Bugfix: Do not strip trailing whitespace from a file or folder name
+
+https://github.com/owncloud/client/issues/9030
+https://github.com/owncloud/client/pull/9452
diff --git a/src/gui/socketapi/socketapi.cpp b/src/gui/socketapi/socketapi.cpp
index 57367049f..f14d873b2 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();