summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3bf0dd1)
raw | patch | inline | side by side (parent: 3bf0dd1)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 17 Jul 2008 05:42:04 +0000 (22:42 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 17 Jul 2008 05:42:04 +0000 (22:42 -0700) |
A patch title "[PATCH] 1" was sanitized by the original code by stripping
the "[PATCH]" from the front, but after the conversion to use strbuf this
behaviour was broken due to a counting error.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the "[PATCH]" from the front, but after the conversion to use strbuf this
behaviour was broken due to a counting error.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mailinfo.c | patch | blob | history |
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 4b8261552a21d1ff074e10cbcf3d79194c7c8281..b99a5b6f9679061d75e9c48e2fa5877e27920dc3 100644 (file)
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
continue;
case '[':
if ((pos = strchr(subject->buf, ']'))) {
- remove = pos - subject->buf + 1;
- /* Don't remove too much. */
- if (remove <= (subject->len - remove + 1) * 2) {
- strbuf_remove(subject, 0, remove);
+ remove = pos - subject->buf;
+ if (remove <= (subject->len - remove) * 2) {
+ strbuf_remove(subject, 0, remove + 1);
continue;
}
} else