]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
* lily/mensural-ligature.cc (internal_brew_primitive): Bugfix:
[lilypond.git] / lily / lily-guile.cc
index 065ea388eedf3054a4f063adb5586350f1cf09f9..e1a0e9bffdc059fde75766d07b559dff3393bd2e 100644 (file)
@@ -105,10 +105,8 @@ gulp_file_to_string (string fn, bool must_exist, int size)
   if (be_verbose_global)
     progress_indication ("[" + s);
 
-  int n = size;
-  char *str = gulp_file (s, &n);
-  string result (str, n);
-  delete[] str;
+  vector<char> chars = gulp_file (s, size);
+  string result (&chars[0], chars.size ());
 
   if (be_verbose_global)
     progress_indication ("]");
@@ -131,7 +129,7 @@ ly_scm2string (SCM str)
 {
   assert (scm_is_string (str));
   return string (scm_i_string_chars (str),
-                    (int) scm_i_string_length (str));
+                (int) scm_i_string_length (str));
 }
 
 char *
@@ -498,7 +496,9 @@ scm_default_compare (void const *a, void const *b)
   return pa < pb ? -1 : 1;
 }
 
-/*  Modify LST in place: qsort it.  */
+/*  Modify LST in place: qsort it.
+
+FIXME: unused, junk? */
 SCM
 ly_list_qsort_uniq_x (SCM lst)
 {
@@ -653,6 +653,14 @@ robust_scm2offset (SCM k, Offset o)
   return o;
 }
 
+string
+robust_scm2string (SCM k, string s)
+{
+  if (scm_is_string (k))
+    s = ly_scm2string (k);
+  return s;
+}
+
 int
 robust_scm2int (SCM k, int o)
 {
@@ -740,3 +748,4 @@ mangle_cxx_identifier (string cxx_id)
   cxx_id = replace_all (cxx_id, '_', '-');
   return cxx_id;
 }
+