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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/core/StarDirectives.cpp4
-rw-r--r--source/core/StarImageProcessing.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp
index fd4ee46..7149f70 100644
--- a/source/core/StarDirectives.cpp
+++ b/source/core/StarDirectives.cpp
@@ -25,8 +25,8 @@ Directives::Entry::Entry(Entry const& other) {
}
StringView Directives::Entry::string(Shared const& parent) const {
- StringView result(parent.string);
- result = result.substr(begin, length);
+ StringView result = parent.string;
+ result = result.utf8().substr(begin, length);
return result;
}
diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp
index 0330a2d..8473975 100644
--- a/source/core/StarImageProcessing.cpp
+++ b/source/core/StarImageProcessing.cpp
@@ -150,7 +150,8 @@ ImageOperation imageOperationFromString(StringView string) {
try {
List<StringView> bits;
string.forEachSplitAnyView("=;", [&](StringView split, size_t, size_t) {
- bits.emplace_back(split);
+ if (!split.empty())
+ bits.emplace_back(split);
});
String type = bits.at(0);