From 2341f8bbc23622d0d8b8a511b7cc745d20beb878 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Wed, 27 May 2009 19:22:28 +0200 Subject: [PATCH] Remove unused unescape_URI() and unescape_URI_duplicate() (cherry picked from commit b5687139f9ac84a7bdf03d9a9612950c43fe6ec2) --- include/vlc_url.h | 2 -- src/libvlccore.sym | 2 -- src/text/strings.c | 83 ---------------------------------------------- 3 files changed, 87 deletions(-) diff --git a/include/vlc_url.h b/include/vlc_url.h index 448c685435..e5b29eba23 100644 --- a/include/vlc_url.h +++ b/include/vlc_url.h @@ -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 ) ); diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 0b0f405ea3..69eddaca04 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -382,8 +382,6 @@ tls_ClientCreate tls_ClientDelete ToLocale ToLocaleDup -unescape_URI -unescape_URI_duplicate update_Check update_Delete update_Download diff --git a/src/text/strings.c b/src/text/strings.c index 9c6d9315e1..736bb87259 100644 --- a/src/text/strings.c +++ b/src/text/strings.c @@ -48,89 +48,6 @@ #include #include -/** - * 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 -- 2.39.2