summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-11-01 00:18:49 +0100
committerPetr Mrázek <peterix@gmail.com>2018-11-01 00:18:49 +0100
commit59e2f52db75c91c39ffa0ad1d1891fe365f187e2 (patch)
tree8816fbe27b433e8f85784ab2e1fc8766fbfb2be8 /api
parentd5037d4f795242998e1a296a592df460a545b6f6 (diff)
downloadMultiMC-59e2f52db75c91c39ffa0ad1d1891fe365f187e2.tar
MultiMC-59e2f52db75c91c39ffa0ad1d1891fe365f187e2.tar.gz
MultiMC-59e2f52db75c91c39ffa0ad1d1891fe365f187e2.tar.lz
MultiMC-59e2f52db75c91c39ffa0ad1d1891fe365f187e2.tar.xz
MultiMC-59e2f52db75c91c39ffa0ad1d1891fe365f187e2.zip
GH-2238 fix issues with whitespace/newlines in folder and instance names
Diffstat (limited to 'api')
-rw-r--r--api/logic/BaseInstance.cpp2
-rw-r--r--api/logic/FileSystem.cpp2
2 files changed, 2 insertions, 2 deletions
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)
{