isabanin/pretty_diff — pull request #7 by chrisledet (2013-05-22 22:19:37+00:00)
Title: Fixed generated HTML for edge case chunk.

The HTML generated is incorrect when the diff chunk contained characters after the last pair of `@@`.

For example, given the diff:

```diff
@@ -23,11 +23,11 @@ OSFileEntry::OSFileEntry(const Polycode::String& fullPath, int type) {
std::vector parts = fullPath.split("/");

if(parts.size() > 0) {
- String path = parts[0];
+ String path = parts[0]; // this is line 26

if(parts.size() > 1) {
for(int i=1; i < parts.size()-1; i++) {
- path += "/" + parts[i];
+ path += "/" + parts[i]; // this is line 30
}
init(path, parts[parts.size()-1], type);
}
```

It would count the following as line 23:
```cpp
OSFileEntry::OSFileEntry(const Polycode::String& fullPath, int type) {
````

But line 23 actually starts after the chunk's line. Regardless of code being on the same line as the diff chunk. So the correct line 23 is:
```cpp
std::vector parts = fullPath.split("/");
```

This patch fixes this issue.