Add backslash to list of 'crud' characters in real name
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Dec 2008 16:41:50 +0000 (08:41 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Dec 2008 23:29:13 +0000 (15:29 -0800)
We remove crud characters at the beginning and end of real-names so that
when we see email addresses like

From: "David S. Miller" <davem@davemloft.net>

we drop the quotes around the name when we parse that and split it up into
name and email.

However, the list of crud characters was basically just a random list of
common things that are found around names, and it didn't contain the
backslash character that some insane scripts seem to use when quoting
things. So now the kernel has a number of authors listed like

Author: \"Rafael J. Wysocki\ <rjw@sisk.pl>

because the author name had started out as

From: \"Rafael J. Wysocki\" <rjw@sisk.pl>

and the only "crud" character we noticed and removed was the final
double-quote at the end.

We should probably do better quote removal from names anyway, but this is
the minimal obvious patch.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ident.c
diff --git a/ident.c b/ident.c
index 09cf0c95c9bfc24fa3e4a8f9e212ec42b8a55eba..99f1c85ea5f5c83247f7affd3d801ff5c14393a6 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -121,6 +121,7 @@ static int crud(unsigned char c)
                c == '<' ||
                c == '>' ||
                c == '"' ||
+               c == '\\' ||
                c == '\'';
 }