openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/systemd/1_242+AUTOINC+db2e367bfc-r0/git/src/libsystemd/sd-bus/bus-internal.c
static bool simple_pattern_check(char c, const char* a, const char* b)
{
    bool separator = false;

    if (!a && !b)
        return true;

    if (!a || !b)
        return false;

    for (;;)
    {
        if (*a != *b)
            return *a == 0 && (*b == c || separator);

        if (*a == 0)
            return true;

        separator = *a == c;

        a++, b++;
    }
}
/*
 * Simple pattern match
 * This checks whether @a is a 'simple-prefix' of @b, based on strings that
 * consist of labels with @c as separator. This function returns true, if:
 *   - if @a and @b are equal
 *   - if @a is a prefix of @b, and the first following character in @b (or the
 *     last character in @a) is @c
 * The second rule basically makes sure that if @a is a prefix of @b, then @b
 * must follow with a new label separated by @c. It cannot extend the label.
 */
Simple pattern match
This checks whether @a is a 'simple-prefix' of @b, based on strings that
consist of labels with @c as separator.
Simple pattern match This checks whether @a is a ' simple - prefix ' of @b based on strings that consist of labels with @c as separator .
static bool simple_pattern_check(char c, const char* a, const char* b)
{
    bool separator = false;
    if (!a && !b)
        return true;
    if (!a || !b)
        return false;
    for (;;)
    {
        if (*a != *b)
            return *a == 0 && (*b == c || separator);
        if (*a == 0)
            return true;
        separator = *a == c;
        a++, b++;
    }
}
static bool simple_pattern_check ( char c , const char * a , const char * b ) { bool separator = false ; if ( ! a && ! b ) return true ; if ( ! a || ! b ) return false ; for ( ; ; ) { if ( * a != * b ) return * a == 0 && ( * b == c || separator ) ; if ( * a == 0 ) return true ; separator = * a == c ; a ++ , b ++ ; } }
Simple pattern match
 This checks whether @a is a 'simple-prefix' of @b, based on strings that
 consist of labels with @c as separator.
Simple pattern match This checks whether @a is a ' simple - prefix ' of @b based on strings that consist of labels with @c as separator .