[vlc-commits] skins2(Win): fix another multibyte issue

Erwan Tulou git at videolan.org
Fri Jun 12 21:48:56 CEST 2015


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Fri Jun 12 10:38:06 2015 +0200| [9e9fd90d0ccf75eb51ae5a2624f7efc8b317581c] | committer: Erwan Tulou

skins2(Win): fix another multibyte issue

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9e9fd90d0ccf75eb51ae5a2624f7efc8b317581c
---

 modules/gui/skins2/src/theme_repository.cpp |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/gui/skins2/src/theme_repository.cpp b/modules/gui/skins2/src/theme_repository.cpp
index 094ebcd..0efb378 100644
--- a/modules/gui/skins2/src/theme_repository.cpp
+++ b/modules/gui/skins2/src/theme_repository.cpp
@@ -26,8 +26,9 @@
 #include "../commands/async_queue.hpp"
 #include "../commands/cmd_dialogs.hpp"
 #include <unistd.h>
+#include <sys/stat.h>
 
-#include <fstream>
+#include <vlc_fs.h>
 
 
 ThemeRepository *ThemeRepository::instance( intf_thread_t *pIntf )
@@ -88,17 +89,17 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
 
     // retrieve last skins stored or skins requested by user
     char* psz_current = var_InheritString( getIntf(), "skins2-last" );
-    string current = string( psz_current ? psz_current : "" );
+    string current( psz_current ? psz_current : "" );
     free( psz_current );
 
-    // check if skins exists and is readable
-    bool b_readable = !ifstream( sToLocale(current).c_str() ).fail();
-
+    // check if skin exists
+    struct stat stat;
+    bool b_exists = !vlc_stat( current.c_str(), &stat );
     msg_Dbg( getIntf(), "requested skins %s is %s accessible",
-                         current.c_str(), b_readable ? "" : "NOT" );
+                         current.c_str(), b_exists ? "" : "NOT" );
 
     // set the default skins if given skins not accessible
-    if( !b_readable && b_default_found )
+    if( !b_exists && b_default_found )
         current = itdefault->second;
 
     // save this valid skins for reuse



More information about the vlc-commits mailing list