summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-01-29 13:18:53 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-01-29 13:18:53 -0800
commitbff64a9cdabee8476ad1d2e45f586a2d6a884363 (patch)
tree8e40ea0492651a36c7b615e19c04b500c152bf29 /builtin
parentMerge branch 'pw/p4-view-updates' (diff)
parentmailinfo: with -b, keep space after [foo] (diff)
downloadtgif-bff64a9cdabee8476ad1d2e45f586a2d6a884363.tar.xz
Merge branch 'tr/maint-mailinfo'
* tr/maint-mailinfo: mailinfo: with -b, keep space after [foo] am: learn passing -b to mailinfo Conflicts: git-am.sh
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mailinfo.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index bfb32b7233..eaf9e157a3 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -250,8 +250,17 @@ static void cleanup_subject(struct strbuf *subject)
(7 <= remove &&
memmem(subject->buf + at, remove, "PATCH", 5)))
strbuf_remove(subject, at, remove);
- else
+ else {
at += remove;
+ /*
+ * If the input had a space after the ], keep
+ * it. We don't bother with finding the end of
+ * the space, since we later normalize it
+ * anyway.
+ */
+ if (isspace(subject->buf[at]))
+ at += 1;
+ }
continue;
}
break;