]> git.sesse.net Git - vlc/commitdiff
Do not try to load non-existing skins files
authorRafaël Carré <funman@videolan.org>
Wed, 22 Aug 2007 21:44:52 +0000 (21:44 +0000)
committerRafaël Carré <funman@videolan.org>
Wed, 22 Aug 2007 21:44:52 +0000 (21:44 +0000)
modules/gui/skins2/src/theme_loader.cpp

index bcc75660a10bdca805a17cad66d3ec0db3c24075..a304ed491c356b04400a15032a7a29b6b20ee4bc 100644 (file)
@@ -75,9 +75,16 @@ int makedir( const char *newdir );
 
 bool ThemeLoader::load( const string &fileName )
 {
+    string path = getFilePath( fileName );
+
+    //Before all, let's see if the file is present
+    struct stat p_stat;
+    if( utf8_stat( path.c_str(), &p_stat ) )
+        return false;
+
     // First, we try to un-targz the file, and if it fails we hope it's a XML
     // file...
-    string path = getFilePath( fileName );
+
 #if defined( HAVE_ZLIB_H )
     if( ! extract( sToLocale( fileName ) ) && ! parse( path, fileName ) )
         return false;