mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-23 11:27:38 +02:00
Split returns empty last element
This commit is contained in:
parent
ad6ab1ad3b
commit
15a3cf9680
2 changed files with 21 additions and 2 deletions
|
@ -162,6 +162,10 @@ std::vector<std::string>& split(const std::string& s, char delim, std::vector<st
|
|||
{
|
||||
elems.push_back(item);
|
||||
}
|
||||
|
||||
if (!s.empty() && (s.back() == delim))
|
||||
elems.emplace_back("");
|
||||
|
||||
return elems;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue