#if defined( HAVE_ZLIB_H )
# include <zlib.h>
# include <errno.h>
-int gzopen_frontend ( char *pathname, int oflags, int mode );
+int gzopen_frontend ( const char *pathname, int oflags, int mode );
int gzclose_frontend( int );
int gzread_frontend ( int, void *, size_t );
int gzwrite_frontend( int, const void *, size_t );
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;
// Show the windows
pNewTheme->getWindowManager().showAll( true );
}
- if( skin_last ) free( skin_last );
+ free( skin_last );
// The new theme cannot embed a video output yet
VlcProc::instance( getIntf() )->dropVout();
// Allocate the buffer
void *pBuffer = malloc( ZIP_BUFFER_SIZE );
if( !pBuffer )
- {
- msg_Err( getIntf(), "failed to allocate memory" );
return false;
- }
// Get the path of the file
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
{
fprintf( stderr, "error writing %s skipping...\n", fname );
fclose( outfile );
+ outfile = NULL;
unlink( fname );
}
}
static int currentGzFd = -1;
static void * currentGzVp = NULL;
-int gzopen_frontend( char *pathname, int oflags, int mode )
+int gzopen_frontend( const char *pathname, int oflags, int mode )
{
- char *gzflags;
+ const char *gzflags;
gzFile gzf;
switch( oflags )