-#!/usr/bin/python
+#!/usr/bin/env python
#
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
buf = ''
state = 2
+ elif hunk and line.startswith('\ No newline at end of file'):
+ # If we had a hunk and now we see this, it's part of the patch,
+ # and we're still expecting another @@ line.
+ patchbuf += line
+
elif hunk:
state = 1
buf += line