Re: [PATCH 13/40] Introduce strncmp_iw

Yao Qi
2017-06-29T08:42:32Z

Pedro Alves <palves@redhat.com> writes:

> +/* Do a strncmp() type operation on STRING1 and STRING2, ignoring any
> + differences in whitespace. STRING2_LEN is STRING2's length.
> + Returns 0 if STRING1 matches STRING2_LEN characters of STRING2,
> + non-zero otherwise (slightly different than strncmp()'s range of
> + return values). */
> +extern int strncmp_iw (const char *, const char *, size_t);

Use parameter name in the declaration, otherwise, STRING1, STRING2 and
STRING2_LEN in comments are pointless.

> +
> +/* Do a strcmp() type operation on STRING1 and STRING2, ignoring any
> + differences in whitespace. Returns 0 if they match, non-zero if
> + they don't (slightly different than strcmp()'s range of return
> + values).
> +
> + As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO".
> + This "feature" is useful when searching for matching C++ function
> + names (such as if the user types 'break FOO', where FOO is a
> + mangled C++ function). */
> extern int strcmp_iw (const char *, const char *);

Otherwise, patch is good to me.

--
Yao (齐尧)