]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/source-file.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / source-file.cc
index 57d67b464b6e16b83d14ca454b841197ba2bcacc..e6aae1ceaebd05be3c197777c1032babc52c1450 100644 (file)
@@ -51,7 +51,7 @@ gulp_file (string filename, int desired_size)
   FILE *f = fopen (filename.c_str (), "rb");
   if (!f)
     {
-      warning (_f ("can't open file: `%s'", filename.c_str ()));
+      warning (_f ("cannot open file: `%s'", filename.c_str ()));
 
       vector<char> cxx_arr;
       return cxx_arr;
@@ -138,9 +138,9 @@ Source_file::Source_file (string filename_string)
 void
 Source_file::init_port ()
 {
-  SCM str = scm_makfrom0str (c_str ());
+  SCM str = scm_from_locale_string (c_str ());
   str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
-  scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ()));
+  scm_set_port_filename_x (str_port_, ly_string2scm (name_));
 }
 
 
@@ -277,12 +277,11 @@ Source_file::get_counts (char const *pos_str0,
 
   while (left > 0)
     {
-      wchar_t multibyte[2];
-
       /*
        FIXME, this is apparently locale dependent.
       */
 #if HAVE_MBRTOWC
+      wchar_t multibyte[2];
       size_t thislen = mbrtowc (multibyte, line_chars, left, &state);
 #else
       size_t thislen = 1;