]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/std-string.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / flower / std-string.cc
index 855193ecb07b0a8849e66dec01f5a3e21224b0f0..6d8ebd52f5ba7fe7d00319176feec7150b14eb9d 100644 (file)
@@ -89,8 +89,9 @@ string_copy (string s)
 {
   ssize len = s.length ();
   char *dest = new char[len + 1];
-  //s.copy (dest, len + 1);
-  memcpy (dest, s.c_str (), len + 1);
+  copy (s.begin (), s.end (), dest);
+  dest[len] = 0;
+  
   return dest;
 }
 
@@ -101,11 +102,13 @@ string_compare (string const &a, string const &b)
 }
 
 #include "std-vector.hh"
+
 vector<string>
 string_split (string str, char c)
 {
-  vector<string> a;
   ssize i = str.find (c);
+
+  vector<string> a;
   while (i != NPOS)
     {
       string s = str.substr (0, i);