mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
Remove unused unescape_URI() and unescape_URI_duplicate()
(cherry picked from commit b5687139f9ac84a7bdf03d9a9612950c43fe6ec2)
This commit is contained in:
parent
5acc222066
commit
2341f8bbc2
@ -45,8 +45,6 @@ struct vlc_url_t
|
||||
char *psz_buffer; /* to be freed */
|
||||
};
|
||||
|
||||
VLC_EXPORT( char *, unescape_URI_duplicate, ( const char *psz ) );
|
||||
VLC_EXPORT( void, unescape_URI, ( char *psz ) );
|
||||
VLC_EXPORT( char *, decode_URI_duplicate, ( const char *psz ) );
|
||||
VLC_EXPORT( char *, decode_URI, ( char *psz ) );
|
||||
VLC_EXPORT( char *, encode_URI_component, ( const char *psz ) );
|
||||
|
@ -382,8 +382,6 @@ tls_ClientCreate
|
||||
tls_ClientDelete
|
||||
ToLocale
|
||||
ToLocaleDup
|
||||
unescape_URI
|
||||
unescape_URI_duplicate
|
||||
update_Check
|
||||
update_Delete
|
||||
update_Download
|
||||
|
@ -48,89 +48,6 @@
|
||||
#include <vlc_url.h>
|
||||
#include <vlc_charset.h>
|
||||
|
||||
/**
|
||||
* Unescape URI encoded string
|
||||
* \return decoded duplicated string
|
||||
*/
|
||||
char *unescape_URI_duplicate( const char *psz )
|
||||
{
|
||||
char *psz_dup = strdup( psz );
|
||||
unescape_URI( psz_dup );
|
||||
return psz_dup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unescape URI encoded string in place
|
||||
* \return nothing
|
||||
*/
|
||||
void unescape_URI( char *psz )
|
||||
{
|
||||
unsigned char *in = (unsigned char *)psz, *out = in, c;
|
||||
if( psz == NULL )
|
||||
return;
|
||||
|
||||
while( ( c = *in++ ) != '\0' )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
case '%':
|
||||
{
|
||||
char val[5], *pval = val;
|
||||
unsigned long cp;
|
||||
|
||||
switch( c = *in++ )
|
||||
{
|
||||
case '\0':
|
||||
return;
|
||||
|
||||
case 'u':
|
||||
case 'U':
|
||||
if( ( *pval++ = *in++ ) == '\0' )
|
||||
return;
|
||||
if( ( *pval++ = *in++ ) == '\0' )
|
||||
return;
|
||||
c = *in++;
|
||||
|
||||
default:
|
||||
*pval++ = c;
|
||||
if( ( *pval++ = *in++ ) == '\0' )
|
||||
return;
|
||||
*pval = '\0';
|
||||
}
|
||||
|
||||
cp = strtoul( val, NULL, 0x10 );
|
||||
if( cp < 0x80 )
|
||||
*out++ = cp;
|
||||
else
|
||||
if( cp < 0x800 )
|
||||
{
|
||||
*out++ = (( cp >> 6) | 0xc0);
|
||||
*out++ = (( cp & 0x3f) | 0x80);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( cp < 0x10000 );
|
||||
*out++ = (( cp >> 12) | 0xe0);
|
||||
*out++ = (((cp >> 6) & 0x3f) | 0x80);
|
||||
*out++ = (( cp & 0x3f) | 0x80);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* + is not a special case - it means plus, not space. */
|
||||
|
||||
default:
|
||||
/* Inserting non-ASCII or non-printable characters is unsafe,
|
||||
* and no sane browser will send these unencoded */
|
||||
if( ( c < 32 ) || ( c > 127 ) )
|
||||
*out++ = '?';
|
||||
else
|
||||
*out++ = c;
|
||||
}
|
||||
}
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode encoded URI component. See also decode_URI().
|
||||
* \return decoded duplicated string
|
||||
|
Loading…
Reference in New Issue
Block a user