Stefan Beller <[email protected]> writes:
> +static int submodule_valid_label_name(const char *label)
> +{
> + if (!label || !strlen(label))
> + return 0;
> +
> + if (!isalnum(*label))
> + return 0;
I'd limit this one to isalpha() if I were doing this to make the
restriction similar to identifiers in traditional programming
language.
> + while (*label) {
> + if (!(isalnum(*label) ||
> + *label == '-'))
And throw in '_' to the mix while at it.
> + return 0;
> + label++;
> + }
> +
> + return 1;
> +}
If the convention is "0 is good", then please signal "bad" with a
negative value, not just "non-zero".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html