Comment 3 for bug 670159

Revision history for this message
Aaron Bentley (abentley) wrote :

If next has ended, your patch is malformed. The @@ line describes the number of lines in the original and modified versions of the hunk. In your example, the original version should have 6 lines and the modified version should have 13. Iteration should not end before the promised number of lines have been provided.

Your example appears to have 5 lines in the original version and 12 in the modified version (i.e. the last line is missing). This means it is malformed. This implementation is designed for exact patch parsing-- it transforms the exact original original text into the exact modified text. It does not handle cases where a text other than the original text is provided as an input, or where the patch data is inconsistent. In such cases, I recommend using GNU patch or similar tools.