diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-10 15:51:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-10 15:55:45 -0400 |
commit | c23be46c1531eb69559948cdc23f85e612c8b1a6 (patch) | |
tree | d68209a77bee5cdb7e8be078f8a611581a7ac658 | |
parent | f108664785893f6c0e1121b94b7dc06896e69af6 (diff) |
use g_fopen() to avoid i18n errors with file paths/names
-rw-r--r-- | libs/evoral/src/SMF.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index b6ec8ecba7..45109b50e5 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -22,7 +22,11 @@ #include <cmath> #include <iostream> #include <stdint.h> + +#include <glib/gstdio.h> + #include "libsmf/smf.h" + #include "evoral/Event.hpp" #include "evoral/SMF.hpp" #include "evoral/midi_util.h" @@ -78,7 +82,7 @@ SMF::seek_to_track(int track) bool SMF::test(const std::string& path) { - FILE* f = fopen(path.c_str(), "r"); + FILE* f = g_fopen(path.c_str(), "r"); if (f == 0) { return false; } @@ -108,7 +112,7 @@ SMF::open(const std::string& path, int track) THROW_FILE_ERROR smf_delete(_smf); } - FILE* f = fopen(path.c_str(), "r"); + FILE* f = g_fopen(path.c_str(), "r"); if (f == 0) { return -1; } else if ((_smf = smf_load(f)) == 0) { @@ -176,7 +180,7 @@ SMF::create(const std::string& path, int track, uint16_t ppqn) THROW_FILE_ERROR { /* put a stub file on disk */ - FILE* f = fopen (path.c_str(), "w+"); + FILE* f = g_fopen (path.c_str(), "w+"); if (f == 0) { return -1; } @@ -405,7 +409,7 @@ SMF::end_write(string const & path) THROW_FILE_ERROR return; } - FILE* f = fopen (path.c_str(), "w+"); + FILE* f = g_fopen (path.c_str(), "w+"); if (f == 0) { throw FileError (path); } |