From: Linus Torvalds Date: Sun, 17 Apr 2005 23:52:54 +0000 (-0700) Subject: Remove extraneous ',' ';' and '.' characters from the full name gecos field. X-Git-Tag: v0.99~841 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5e5128ed1cf4223fd32a36f858263d361ade5310;p=git.git Remove extraneous ',' ';' and '.' characters from the full name gecos field. Apparently some distributions tend to have space for phone numbers etc there. --- diff --git a/commit-tree.c b/commit-tree.c index b2095754..93f3a579 100644 --- a/commit-tree.c +++ b/commit-tree.c @@ -96,6 +96,21 @@ static void remove_special(char *p) if (!c) break; } + + /* + * Go back, and remove crud from the end: some people + * have commas etc in their gecos field + */ + dst--; + while (--dst >= p) { + unsigned char c = *dst; + switch (c) { + case ',': case ';': case '.': + *dst = 0; + continue; + } + break; + } } static const char *month_names[] = {