From 92bbe45dd031c7a14b9ba55a77a27d66cf07b876 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 20 Feb 2007 00:09:23 +0000 Subject: (svn r8821) -Regression: Unable to browse directories on *nix if the filesystem is not in UTF-8 charset and special characters are used. The string passed to opendir() which is UTF-8 was not parsed back to the filesystem format. Use a wrapper called ttd_opendir() instead of redefining opendir itself. --- src/fios.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fios.cpp') diff --git a/src/fios.cpp b/src/fios.cpp index 615570742..c8d7fdf8d 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -224,7 +224,7 @@ static FiosItem *FiosGetFileList(int mode, fios_getlist_callback_proc *callback_ } /* Show subdirectories */ - if (mode != SLD_NEW_GAME && (dir = opendir(_fios_path)) != NULL) { + if (mode != SLD_NEW_GAME && (dir = ttd_opendir(_fios_path)) != NULL) { while ((dirent = readdir(dir)) != NULL) { ttd_strlcpy(d_name, FS2OTTD(dirent->d_name), sizeof(d_name)); @@ -254,7 +254,7 @@ static FiosItem *FiosGetFileList(int mode, fios_getlist_callback_proc *callback_ sort_start = _fios_count; /* Show files */ - dir = opendir(_fios_path); + dir = ttd_opendir(_fios_path); if (dir != NULL) { while ((dirent = readdir(dir)) != NULL) { char fios_title[64]; -- cgit v1.2.3-54-g00ecf