Skip to content

Commit 3a32ca5

Browse files
committed
Fix loading controller configs from non-ASCII paths on Windows
1 parent 683e00a commit 3a32ca5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Version 2.7.5dev:
22

3+
* Fix loading controller configs from non-ASCII paths on Windows.
34
* Better (build-time) OpenAL detection on OS X.
45
* New configure option --with-libmpeg2=yes/builtin (no won't work yet),
56
defaults to yes (using system library).

libinih/ini.c

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ home page for more info:
77
88
*/
99

10+
#ifdef HAVE_CONFIG_H
11+
#include "config.h"
12+
#endif
13+
14+
#ifdef USE_GLIB
15+
#include <glib.h>
16+
#endif
17+
1018
#ifdef _MSC_VER
1119
#define _CRT_SECURE_NO_WARNINGS
1220
#endif
@@ -178,7 +186,11 @@ int ini_parse(const char* filename, ini_handler handler, void* user)
178186
FILE* file;
179187
int error;
180188

189+
#ifdef USE_GLIB
190+
file = g_fopen(filename, "r");
191+
#else
181192
file = fopen(filename, "r");
193+
#endif
182194
if (!file)
183195
return -1;
184196
error = ini_parse_file(file, handler, user);

0 commit comments

Comments
 (0)