Version: 3.5.4 (using KDE 4.2.4) OS: Linux Installed from: Ubuntu Packages When diffing the following two files, kompare comes up with an empty window. Looks like kompare is confused by the triple minus in the diff output. $ kompare -v Qt: 4.5.0 KDE: 4.2.2 (KDE 4.2.2) Kompare: 3.5.4 $ cat a_1 -- foo $ cat a_2 -- bar $ diff -u a_1 a_2 --- a_1 2009-08-18 10:42:02.000000000 +0200 +++ a_2 2009-08-18 10:42:07.000000000 +0200 @@ -1 +1 @@ --- foo +-- bar $ diff -u a_1 a_2 | kompare -
Please note that this report is actually for KDE 4.2.2 for which I couldn't file a bug. As I have no means to try it with a more recent version of KDE, someone would need to verify if it is indeed broken on 4.2.4.
It almost certainly is, we didn't do anything to fix it in the 4.2 branch before 4.2.4 or in the 4.3 branch before 4.3.0 (nor is this fixed in the current 4.3 branch or trunk as far as I know).
I had a look at the sources for kompare. The problem seems to be that ParserBase::parseUnifiedHunkBody() stops reading the hunk body as soon as it finds a line matching m_unifiedDiffHeader1 (e.g. '--- blahblah'). This happens because ParserBase::matchesUnifiedHunkLine() returns False for such lines. I think the parsing of the hunk body must take into account the full information from the hunk header, because otherwise you cannot reliably tell where the hunk body ends.
Created attachment 36277 [details] Fix parsing of unified diffs This patch for libdiff2 modifies the parsing of unified diffs to take into account the full information given in the diff header. Now kompare correctly displays the unified diff example I gave earlier.
Patch looks sane. Can someone confirm that this fixes the bug with this testcase? I dont have a working KDE atm. Please also add this testcase for this bug to the testcases in kompare so we can make sure this bug does not return. Thank you very much for reporting the bug and for the patch!
*** This bug has been marked as a duplicate of bug 208688 ***