From c23be46c1531eb69559948cdc23f85e612c8b1a6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 10 May 2016 15:51:08 -0400 Subject: [PATCH] use g_fopen() to avoid i18n errors with file paths/names --- libs/evoral/src/SMF.cpp | 12 ++++++++---- 1 file 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 #include #include + +#include + #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); } -- 2.30.2