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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user