Commit ae4fd576 authored by Max Kellermann's avatar Max Kellermann

output/ao: use IterableSplitString() instead of SplitString()

parent 747436b1
......@@ -22,7 +22,7 @@
#include "thread/SafeSingleton.hxx"
#include "system/Error.hxx"
#include "util/DivideString.hxx"
#include "util/SplitString.hxx"
#include "util/IterableSplitString.hxx"
#include "util/RuntimeError.hxx"
#include "util/Domain.hxx"
#include "util/StringAPI.hxx"
......@@ -122,14 +122,16 @@ AoOutput::AoOutput(const ConfigBlock &block)
value = block.GetBlockValue("options", nullptr);
if (value != nullptr) {
for (const auto &i : SplitString(value, ';')) {
const DivideString ss(i.c_str(), '=', true);
for (StringView i : IterableSplitString(value, ';')) {
i.Strip();
if (!ss.IsDefined())
throw FormatRuntimeError("problems parsing options \"%s\"",
i.c_str());
auto s = i.Split('=');
if (s.first.empty() || s.second.IsNull())
throw FormatRuntimeError("problems parsing option \"%.*s\"",
int(i.size), i.data);
ao_append_option(&options, ss.GetFirst(), ss.GetSecond());
const std::string n(s.first), v(s.second);
ao_append_option(&options, n.c_str(), v.c_str());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment