static struct URLProtocol *url_find_protocol(const char *filename)

{

    URLProtocol *up = NULL;

    char proto_str[128], proto_nested[128], *ptr;

    size_t proto_len = strspn(filename, URL_SCHEME_CHARS);



    if (filename[proto_len] != ':' &&

        (filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||

        is_dos_path(filename))

        strcpy(proto_str, "file");

    else

        av_strlcpy(proto_str, filename,

                   FFMIN(proto_len + 1, sizeof(proto_str)));



    if ((ptr = strchr(proto_str, ',')))

        *ptr = '\0';

    av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));

    if ((ptr = strchr(proto_nested, '+')))

        *ptr = '\0';



    while (up = ffurl_protocol_next(up)) {

        if (!strcmp(proto_str, up->name))

            break;

        if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(proto_nested, up->name))

            break;

    }



    return up;

}

static struct URLProtocol *url_find_protocol(const char *filename)

{

    URLProtocol *up = NULL;

    char proto_str[128], proto_nested[128], *ptr;

    size_t proto_len = strspn(filename, URL_SCHEME_CHARS);



    if (filename[proto_len] != ':' &&

        (filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||

        is_dos_path(filename))

        strcpy(proto_str, "file");

    else

        av_strlcpy(proto_str, filename,

                   FFMIN(proto_len + 1, sizeof(proto_str)));



    if ((ptr = strchr(proto_str, ',')))

        *ptr = '\0';

    av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));

    if ((ptr = strchr(proto_nested, '+')))

        *ptr = '\0';



    while (up = ffurl_protocol_next(up)) {

        if (!strcmp(proto_str, up->name))

            break;

        if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(proto_nested, up->name))

            break;

    }



    return up;

}

        (filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||
static struct URLProtocol *FUNC_0(const char *VAR_0)

{

    URLProtocol *VAR_1 = NULL;

    char VAR_2[128], VAR_3[128], *VAR_4;

    size_t proto_len = strspn(VAR_0, URL_SCHEME_CHARS);



    if (VAR_0[proto_len] != ':' &&

        (VAR_0[proto_len] != ',' || !strchr(VAR_0 + proto_len + 1, ':')) ||

        is_dos_path(VAR_0))

        strcpy(VAR_2, "file");

    else

        av_strlcpy(VAR_2, VAR_0,

                   FFMIN(proto_len + 1, sizeof(VAR_2)));



    if ((VAR_4 = strchr(VAR_2, ',')))

        *VAR_4 = '\0';

    av_strlcpy(VAR_3, VAR_2, sizeof(VAR_3));

    if ((VAR_4 = strchr(VAR_3, '+')))

        *VAR_4 = '\0';



    while (VAR_1 = ffurl_protocol_next(VAR_1)) {

        if (!strcmp(VAR_2, VAR_1->name))

            break;

        if (VAR_1->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&

            !strcmp(VAR_3, VAR_1->name))

            break;

    }



    return VAR_1;

}

static struct URLProtocol *FUNC_0(const char *VAR_0)
{ URLProtocol *VAR_1 = NULL; char VAR_2[128], VAR_3[128], *VAR_4; size_t proto_len = strspn(VAR_0, URL_SCHEME_CHARS); if (VAR_0[proto_len] != ':' &&
(VAR_0[proto_len] != ',' || !strchr(VAR_0 + proto_len + 1, ':')) ||
is_dos_path(VAR_0))
strcpy(VAR_2, "file"); else
av_strlcpy(VAR_2, VAR_0,
FFMIN(proto_len + 1, sizeof(VAR_2))); if ((VAR_4 = strchr(VAR_2, ',')))
*VAR_4 = '\0'; av_strlcpy(VAR_3, VAR_2, sizeof(VAR_3)); if ((VAR_4 = strchr(VAR_3, '+')))
*VAR_4 = '\0'; while (VAR_1 = ffurl_protocol_next(VAR_1)) { if (!strcmp(VAR_2, VAR_1->name))
break; if (VAR_1->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
!strcmp(VAR_3, VAR_1->name))
break; } return VAR_1; }