/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include <pbd/strsplit.h>
+#include "pbd/strsplit.h"
using namespace std;
using namespace Glib;
void
split (string str, vector<string>& result, char splitchar)
-{
+{
string::size_type pos;
string remaining;
string::size_type len = str.length();
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);
}
void
split (ustring str, vector<ustring>& result, char splitchar)
-{
+{
ustring::size_type pos;
ustring remaining;
ustring::size_type len = str.length();