openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/libmount/src/optstr.c
int mnt_optstr_remove_option_at(char** optstr, char* begin, char* end)
{
    size_t sz;

    if (!optstr || !begin || !end)
        return -EINVAL;

    if ((begin == *optstr || *(begin - 1) == ',') && *end == ',')
        end++;

    sz = strlen(end);

    memmove(begin, end, sz + 1);
    if (!*begin && (begin > *optstr) && *(begin - 1) == ',')
        *(begin - 1) = '\0';

    return 0;
}
/*
 * The result never starts or ends with a comma or contains two commas
 *    (e.g. ",aaa,bbb" or "aaa,,bbb" or "aaa,")
 */
The result never starts or ends with a comma or contains two commas
The result never starts or ends with a comma or contains two commas
int mnt_optstr_remove_option_at(char** optstr, char* begin, char* end)
{
    size_t sz;
    if (!optstr || !begin || !end)
        return -EINVAL;
    if ((begin == *optstr || *(begin - 1) == ',') && *end == ',')
        end++;
    sz = strlen(end);
    memmove(begin, end, sz + 1);
    if (!*begin && (begin > *optstr) && *(begin - 1) == ',')
        *(begin - 1) = '\0';
    return 0;
}
int mnt_optstr_remove_option_at ( char * * optstr , char * begin , char * end ) { size_t sz ; if ( ! optstr || ! begin || ! end ) return - EINVAL ; if ( ( begin == * optstr || * ( begin - 1 ) == ' ' ) && * end == ' ' ) end ++ ; sz = strlen ( end ) ; memmove ( begin , end , sz + 1 ) ; if ( ! * begin && ( begin > * optstr ) && * ( begin - 1 ) == ' ' ) * ( begin - 1 ) = ' \0 ' ; return 0 ; }
The result never starts or ends with a comma or contains two commas
    (e.g.
The result never starts or ends with a comma or contains two commas ( e . g .