X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=flower%2Fstd-string.cc;h=b78b0196616aa1adde6f46b9ab64df379b523ed5;hb=652caefc07a16d19b00b53fa7d43db7268d91bd0;hp=304ddf33cf773076d1f43f3a70b1d30822a5b7ed;hpb=72bd1ea165831738260e671737d84dbaffe6a6fc;p=lilypond.git diff --git a/flower/std-string.cc b/flower/std-string.cc index 304ddf33cf..b78b019661 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2006 Jan Nieuwenhuizen + (c) 2006--2007 Jan Nieuwenhuizen */ #include "std-string.hh" @@ -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; } @@ -105,8 +106,9 @@ string_compare (string const &a, string const &b) vector string_split (string str, char c) { - vector a; ssize i = str.find (c); + + vector a; while (i != NPOS) { string s = str.substr (0, i);