A few more instances of non-glib 'open()' getting used without locale-specific input...
authorJohn Emmas <johne53@tiscali.co.uk>
Thu, 23 Jul 2015 17:27:00 +0000 (18:27 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Thu, 23 Jul 2015 17:27:00 +0000 (18:27 +0100)
(noticed by Todd. probably more to come...)

libs/ardour/globals.cc
libs/ardour/utils.cc

index fa6f833d94eb29fe64980321e4f4a7228efdf9db..c18d6a9e418f9512726a4c55c55a2d9b8c00ed10 100644 (file)
@@ -61,6 +61,7 @@
 #undef check /* stupid Apple and their un-namespaced, generic Carbon macros */
 #endif 
 
+#include <glibmm/convert.h>
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
 
@@ -647,13 +648,13 @@ static const bool translate_by_default = true;
 string
 ARDOUR::translation_enable_path ()
 {
-        return Glib::build_filename (user_config_directory(), ".translate");
+       return Glib::build_filename (user_config_directory(), ".translate");
 }
 
 bool
 ARDOUR::translations_are_enabled ()
 {
-       int fd = ::open (ARDOUR::translation_enable_path().c_str(), O_RDONLY);
+       int fd = ::open (Glib::locale_from_utf8 (ARDOUR::translation_enable_path()).c_str(), O_RDONLY);
 
        if (fd < 0) {
                return translate_by_default;
@@ -675,7 +676,7 @@ bool
 ARDOUR::set_translations_enabled (bool yn)
 {
        string i18n_enabler = ARDOUR::translation_enable_path();
-       int fd = ::open (i18n_enabler.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
+       int fd = ::open (Glib::locale_from_utf8 (i18n_enabler).c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
 
        if (fd < 0) {
                return false;
index 270aaa37fd5f0c85c00b3d67200c168860fa4cce..71051434c6e6d15a0af67ce11bc07b7e2df74ca9 100644 (file)
@@ -42,6 +42,7 @@
 #include <errno.h>
 #include <regex.h>
 
+#include <glibmm/convert.h>
 #include <glibmm/miscutils.h>
 #include <glibmm/fileutils.h>
 
@@ -299,7 +300,7 @@ ARDOUR::cmp_nocase_utf8 (const string& s1, const string& s2)
 int
 ARDOUR::touch_file (string path)
 {
-       int fd = open (path.c_str(), O_RDWR|O_CREAT, 0660);
+       int fd = open (Glib::locale_from_utf8 (path).c_str(), O_RDWR|O_CREAT, 0660);
        if (fd >= 0) {
                close (fd);
                return 0;