mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
strsplit(): if first char of a string is the separator, don't push an empty string into the return vector
git-svn-id: svn://localhost/ardour2/branches/3.0@6426 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8ae20c0c4d
commit
e00506b0ad
1 changed files with 3 additions and 1 deletions
|
|
@ -50,7 +50,9 @@ split (string str, vector<string>& result, char splitchar)
|
|||
remaining = str;
|
||||
|
||||
while ((pos = remaining.find_first_of (splitchar)) != string::npos) {
|
||||
result.push_back (remaining.substr (0, pos));
|
||||
if (pos != 0) {
|
||||
result.push_back (remaining.substr (0, pos));
|
||||
}
|
||||
remaining = remaining.substr (pos+1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue