From a439f49c4db32a340826ae9b77c940ca59e79e5f Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 7 Jun 2015 07:38:52 +1000 Subject: [PATCH] Fix loop where there was a potential for double entry. --- components/config/gamesettings.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/config/gamesettings.cpp b/components/config/gamesettings.cpp index 1215f0850..2b3a8ba4b 100644 --- a/components/config/gamesettings.cpp +++ b/components/config/gamesettings.cpp @@ -265,7 +265,10 @@ bool Config::GameSettings::writeFileWithComments(QFile &file) // Below is based on readFile() code, if that changes corresponding change may be // required (for example duplicates may be inserted if the rules don't match) if ((*iter).isEmpty() || (*iter).contains(QRegExp("^\\s*#"))) + { stream << *iter << "\n"; + continue; + } if (settingRegex.indexIn(*iter) == -1 || settingRegex.captureCount() < 2) continue;