mailinfo: strip "RE: " prefix
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Sep 2012 09:59:58 +0000 (02:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Sep 2012 09:59:58 +0000 (02:59 -0700)
We already strip the more common Re: and re:, and we do not often
see RE: from saner MUA, but this prefix does exist and gets used
from time to time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailinfo.c

index eaf9e157a3897c2442756911b906ff9d3ee2be90..18895ee4d9c987ec97d6781a5ffe5ec935bf19c7 100644 (file)
@@ -232,7 +232,9 @@ static void cleanup_subject(struct strbuf *subject)
                case 'r': case 'R':
                        if (subject->len <= at + 3)
                                break;
-                       if (!memcmp(subject->buf + at + 1, "e:", 2)) {
+                       if ((subject->buf[at + 1] == 'e' ||
+                            subject->buf[at + 1] == 'E') &&
+                           subject->buf[at + 2] == ':') {
                                strbuf_remove(subject, at, 3);
                                continue;
                        }