diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-01-14 01:17:40 +0000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2012-01-14 19:29:26 +0000 |
commit | b76f7dd32ef83d55ace2f38ed84f5fc76e65e18e (patch) | |
tree | d03324944c9d8d0b5601e66025796242ee10ea23 /apps/patchwork/parser.py | |
parent | 0f3b76430ad276e8956ac388452e007d501cc54d (diff) | |
download | patchwork-b76f7dd32ef83d55ace2f38ed84f5fc76e65e18e.tar.bz2 patchwork-b76f7dd32ef83d55ace2f38ed84f5fc76e65e18e.tar.xz |
parser: allow words starting with "diff" at beginning of line
The patch parser splits emails incorrectly when the comment contains a
line whose first word starts with "diff" (like "difficult" or
"different").
For a real-life example of an email that triggers this bug, see
http://patchwork.ozlabs.org/patch/135291/.
Fix the issue by checking for a space after "diff". Add
DiffWordInCommentTest to the test suite.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/parser.py')
-rw-r--r-- | apps/patchwork/parser.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py index 2b5e9a0..f460566 100644 --- a/apps/patchwork/parser.py +++ b/apps/patchwork/parser.py @@ -68,7 +68,7 @@ def parse_patch(text): line += '\n' if state == 0: - if line.startswith('diff') or line.startswith('===') \ + if line.startswith('diff ') or line.startswith('===') \ or line.startswith('Index: '): state = 1 buf += line |