X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=commit-tree.c;h=cbb7d12a8682992584fe9fc717b6f95666b1ab73;hb=e3b4be7f6c31d85b5f6abc42bd24d61bce5027b4;hp=b20957546ad9b4cac60219845a7c7106830102f8;hpb=d0d7cbe730c31a6e1d12bd68975ff73c60f1de6c;p=git.git diff --git a/commit-tree.c b/commit-tree.c index b2095754..cbb7d12a 100644 --- a/commit-tree.c +++ b/commit-tree.c @@ -83,11 +83,11 @@ static void finish_buffer(char *tag, char **bufp, unsigned int *sizep) static void remove_special(char *p) { char c; - char *dst = p; + char *dst = p, *src = p; for (;;) { - c = *p; - p++; + c = *src; + src++; switch(c) { case '\n': case '<': case '>': continue; @@ -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[] = {