From 59e2f52db75c91c39ffa0ad1d1891fe365f187e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 1 Nov 2018 00:18:49 +0100 Subject: GH-2238 fix issues with whitespace/newlines in folder and instance names --- api/logic/BaseInstance.cpp | 2 +- api/logic/FileSystem.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/logic/BaseInstance.cpp b/api/logic/BaseInstance.cpp index 098407dc..7ddcc549 100644 --- a/api/logic/BaseInstance.cpp +++ b/api/logic/BaseInstance.cpp @@ -244,7 +244,7 @@ QString BaseInstance::name() const QString BaseInstance::windowTitle() const { - return "MultiMC: " + name(); + return "MultiMC: " + name().replace(QRegExp("[ \n\r\t]+"), " "); } // FIXME: why is this here? move it to MinecraftInstance!!! diff --git a/api/logic/FileSystem.cpp b/api/logic/FileSystem.cpp index 7e3c1841..192d868b 100644 --- a/api/logic/FileSystem.cpp +++ b/api/logic/FileSystem.cpp @@ -294,7 +294,7 @@ QString NormalizePath(QString path) } } -QString badFilenameChars = "\"\\/?<>:*|!+"; +QString badFilenameChars = "\"\\/?<>:*|!+\r\n"; QString RemoveInvalidFilenameChars(QString string, QChar replaceWith) { -- cgit v1.2.3