Merge branch 'rs/micro-cleanups'

Code cleanup.

* rs/micro-cleanups:
  use strpbrk(3) to search for characters from a given set
  quote: use isalnum() to check for alphanumeric characters
This commit is contained in:
Junio C Hamano
2020-03-02 15:07:20 -08:00
5 changed files with 5 additions and 6 deletions

View File

@@ -19,8 +19,7 @@ static void cleanup_space(struct strbuf *sb)
static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)
{
struct strbuf *src = name;
if (name->len < 3 || 60 < name->len || strchr(name->buf, '@') ||
strchr(name->buf, '<') || strchr(name->buf, '>'))
if (name->len < 3 || 60 < name->len || strpbrk(name->buf, "@<>"))
src = email;
else if (name == out)
return;