Commit c77acd6e authored by Jean-Philippe André's avatar Jean-Philippe André

Zip: fix opening of files

File paths without file:// don't work anymore
parent 73f81994
......@@ -373,7 +373,21 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
access_t *p_access = (access_t*) opaque;
return stream_UrlNew( p_access, file );
char *fileUri = malloc( strlen(file) + 8 );
if( !fileUri ) return VLC_ENOMEM;
if( !strstr( file, "://" ) )
{
strcpy( fileUri, "file://" );
strcat( fileUri, file );
}
else
{
strcpy( fileUri, file );
}
stream_t *s = stream_UrlNew( p_access, fileUri );
free( fileUri );
return s;
}
/** **************************************************************************
......
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