* Just saw a single line in a fragment. If it is a part of this hunk * that is a context " ", an added "+", or a removed "-" line, it may * be followed by "\\ No newline..." to signal that the last "\n" on * this line needs to be dropped. Depending on locale settings when * the patch was produced we don't know what this line would exactly * say. The only thing we do know is that it begins w
| 1737 | * "\ No newline..." line. |
| 1738 | */ |
| 1739 | static int adjust_incomplete(const char *line, int len, |
| 1740 | unsigned long size) |
| 1741 | { |
| 1742 | int nextlen; |
| 1743 | |
| 1744 | if (*line != '\n' && *line != ' ' && *line != '+' && *line != '-') |
| 1745 | return 0; |
| 1746 | if (size - len < 12 || memcmp(line + len, "\\ ", 2)) |
| 1747 | return 0; |
| 1748 | nextlen = linelen(line + len, size - len); |
| 1749 | if (nextlen < 12) |
| 1750 | return 0; |
| 1751 | return nextlen; |
| 1752 | } |
| 1753 | |
| 1754 | /* |
| 1755 | * Parse a unified diff. Note that this really needs to parse each |
no test coverage detected