[vlc-devel] [PATCH] Parse square brackets in pathnames - ticket #20384

Zhao Zhili quinkblack at foxmail.com
Sun Apr 29 06:04:54 CEST 2018


> On 29 Apr 2018, at 6:37 AM, Cristiano Milia <chainofflowers at gmx.net> wrote:
> 
> When opening a M3U playlist containing relative pathnames, the songs 
> whose pathname contains a square bracket are simply ignored.
> This patch makes vlc_uri_component_validate consider [] as valid
> parts of pathnames.
> 

[] are reserved characters. They should be percent-encoded. I don't think it's a bug of VLC.

> 
> 
> ---
> src/text/url.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/text/url.c b/src/text/url.c
> index 1c86bedb58..65406965e9 100644
> --- a/src/text/url.c
> +++ b/src/text/url.c
> @@ -398,7 +398,7 @@ static bool vlc_uri_host_validate(const char *str)
> 
> static bool vlc_uri_path_validate(const char *str)
> {
> -    return vlc_uri_component_validate(str, "/@:");
> +    return vlc_uri_component_validate(str, "/@:[]");
> }
> 
> static int vlc_UrlParseInner(vlc_url_t *restrict url, const char *str)
> @@ -570,7 +570,7 @@ int vlc_UrlParseFixup(vlc_url_t *url, const char *str)
> {
>     int ret = vlc_UrlParseInner(url, str);
> 
> -    static const char pathextras[] = "/@:";
> +    static const char pathextras[] = "/@:[]";
> 
>     if (url->psz_path != NULL
>      && !vlc_uri_component_validate(url->psz_path, pathextras))
> -- 
> 2.17.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel





More information about the vlc-devel mailing list