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

summaryrefslogtreecommitdiff
path: root/source/core/StarDirectives.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-09-05 16:42:44 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-09-05 16:42:44 +1000
commitc992d4f72a4594c6d77c6cd72ab0335d56930ea8 (patch)
tree85ac5cc8fb1fcabd20e7a861efba2a3d5cf8e3fb /source/core/StarDirectives.cpp
parent51d6e63dfe5bce9812886e0ece5fa62975f38d77 (diff)
Update StarDirectives.cpp
Diffstat (limited to 'source/core/StarDirectives.cpp')
-rw-r--r--source/core/StarDirectives.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp
index dfea7b0..6208b97 100644
--- a/source/core/StarDirectives.cpp
+++ b/source/core/StarDirectives.cpp
@@ -98,8 +98,10 @@ void Directives::loadOperations() const {
}
void Directives::parse(String&& directives) {
- if (directives.empty())
+ if (directives.empty()) {
+ shared.reset();
return;
+ }
List<Entry> newList;
StringView view(directives);
@@ -123,8 +125,10 @@ void Directives::parse(String&& directives) {
}
});
- if (newList.empty() && !prefix.empty())
+ if (newList.empty() && !prefix.empty()) {
+ shared.reset();
return;
+ }
shared = std::make_shared<Shared const>(move(newList), move(directives), prefix);
if (view.size() < 1000) { // Pre-load short enough directives