Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarDirectives.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-11-25 23:03:46 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2023-11-25 23:03:46 +1100
commitf3c7bd1d5e5b4d890ea11f4ee1bff3a978a40103 (patch)
treef471a0e6a1a1bff7c1b72288b7f448387865a1d2 /source/core/StarDirectives.cpp
parent9c7d35ee26ea5f18dc50febaf3456fb711fe36d9 (diff)
Directives fixes
Diffstat (limited to 'source/core/StarDirectives.cpp')
-rw-r--r--source/core/StarDirectives.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp
index 6208b97..4db3837 100644
--- a/source/core/StarDirectives.cpp
+++ b/source/core/StarDirectives.cpp
@@ -277,8 +277,14 @@ String DirectivesGroup::toString() const {
void DirectivesGroup::addToString(String& string) const {
for (auto& directives : m_directives)
- if (directives.shared)
- string += directives.shared->string;
+ if (directives.shared) {
+ auto& dirString = directives.shared->string;
+ if (!dirString.empty()) {
+ if (dirString.utf8().front() != '?')
+ string += "?";
+ string += dirString;
+ }
+ }
}
void DirectivesGroup::forEach(DirectivesCallback callback) const {