summaryrefslogtreecommitdiff
path: root/commit-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 16:52:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 16:52:54 -0700
commit5e5128ed1cf4223fd32a36f858263d361ade5310 (patch)
tree91747f0cff21db6fbdbbc7a97bb7ff2972a9b036 /commit-tree.c
parent08ca0b04ba80b7127dd19b6d17c548eaca057ab3 (diff)
downloadgit-5e5128ed1cf4223fd32a36f858263d361ade5310.tar.gz
Remove extraneous ',' ';' and '.' characters from the full name gecos field.
Apparently some distributions tend to have space for phone numbers etc there.
Diffstat (limited to 'commit-tree.c')
-rw-r--r--commit-tree.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/commit-tree.c b/commit-tree.c
index b20957546a..93f3a57991 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[] = {