Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-15

Re: [PATCH] git mailinfo strips important context from patch subjects

From: Paolo Bonzini <hidden>
Date: 2016-06-15 22:47:00

quoted
case '[':
if ((pos = strchr(subject->buf, ']'))) {
remove = pos - subject->buf;
- if (remove <= (subject->len - remove) * 2) {
+ if (remove <= subject->len * 2 / 3
+ && memmem(subject->buf, remove, 'PATCH', 5)) {
strbuf_remove(subject, 0, remove + 1);
continue;
}

Pardon my ignorance, but wouldn't this still remove not only
"[PATCH 4/5]", but all of [PATCH 4/5] [sbuild]" anyway? The
parameters to strbuf_remove() seem unchanged.
I don't exclude I've screwed up, but note that pos is computed with 
strchr, not strrchr.  Since the second memmem does not find [PATCH], it 
does not remove anything.

(BTW, cairo uses the [...] convention).

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help