Commit 860b31f8 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* backport [18046] utf8 dir wrappers for the mkv module

parent 2c002c7f
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <codecs.h> /* BITMAPINFOHEADER, WAVEFORMATEX */ #include <codecs.h> /* BITMAPINFOHEADER, WAVEFORMATEX */
#include "iso_lang.h" #include "iso_lang.h"
#include "vlc_meta.h" #include "vlc_meta.h"
#include "charset.h"
#include <iostream> #include <iostream>
#include <cassert> #include <cassert>
...@@ -1491,16 +1492,16 @@ static int Open( vlc_object_t * p_this ) ...@@ -1491,16 +1492,16 @@ static int Open( vlc_object_t * p_this )
} }
} }
struct dirent *p_file_item; DIR *p_src_dir = (DIR *)utf8_opendir(s_path.c_str());
DIR *p_src_dir = opendir(s_path.c_str());
if (p_src_dir != NULL) if (p_src_dir != NULL)
{ {
while ((p_file_item = (dirent *) readdir(p_src_dir))) char *psz_file;
while ((psz_file = (char *)utf8_readdir(p_src_dir)) != NULL)
{ {
if (strlen(p_file_item->d_name) > 4) if (strlen(psz_file) > 4)
{ {
s_filename = s_path + DIRECTORY_SEPARATOR + p_file_item->d_name; s_filename = s_path + DIRECTORY_SEPARATOR + psz_file;
#ifdef WIN32 #ifdef WIN32
if (!strcasecmp(s_filename.c_str(), p_demux->psz_path)) if (!strcasecmp(s_filename.c_str(), p_demux->psz_path))
...@@ -1545,6 +1546,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -1545,6 +1546,7 @@ static int Open( vlc_object_t * p_this )
} }
} }
} }
free (psz_file);
} }
closedir( p_src_dir ); closedir( p_src_dir );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment