fix compiler warnings.
[ardour.git] / libs / pbd / strsplit.cc
index b7a7109af4159fe64f3b2f8411972c41b6001a28..f82abf4c92430b7c64014c4c4eb21f70a4d1e22d 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-#include <pbd/strsplit.h>
+#include "pbd/strsplit.h"
 
 using namespace std;
 using namespace Glib;
@@ -49,8 +49,10 @@ split (string str, vector<string>& result, char splitchar)
 
        remaining = str;
 
-       while ((pos = remaining.find_first_of (':')) != string::npos) {
-               result.push_back (remaining.substr (0, pos));
+       while ((pos = remaining.find_first_of (splitchar)) != string::npos) {
+               if (pos != 0) {
+                       result.push_back (remaining.substr (0, pos));
+               }
                remaining = remaining.substr (pos+1);
        }
 
@@ -87,7 +89,7 @@ split (ustring str, vector<ustring>& result, char splitchar)
 
        remaining = str;
 
-       while ((pos = remaining.find_first_of (':')) != ustring::npos) {
+       while ((pos = remaining.find_first_of (splitchar)) != ustring::npos) {
                result.push_back (remaining.substr (0, pos));
                remaining = remaining.substr (pos+1);
        }