Bug 235503 - malformed patches are silently cut off
Summary: malformed patches are silently cut off
Status: RESOLVED FIXED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-27 00:57 UTC by Chani
Modified: 2010-05-19 04:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chani 2010-04-27 00:57:50 UTC
Version:            (using Devel)
Installed from:    Compiled sources

filing this here so kevin won't forget ;)

when patches are badly formed, kompare silently ignores what it thinks are comments. a patch like http://ktown.kde.org/~fredrik/folderview.diff shows up like http://chani.ca/sshots/komparefail.png

the user should be warned when there's stuff in the file that's not visible in the UI (imho there should be an easy way to view these 'comments' too, but I don't care enough to write a patch for that ;)
Comment 1 Kevin Kofler 2010-04-27 01:04:23 UTC
As discussed on IRC, patch errors out on this with "patch: **** malformed patch at line 15: …", I think this is the behavior we'll want to match more or less.

What I suggested on IRC is that we still display what we can, but pop up a KMessageBox complaining about the malformed patch.
Comment 2 Kevin Kofler 2010-05-19 03:47:00 UTC
I'm taking care of this now, given the impending message freeze.
Comment 3 Kevin Kofler 2010-05-19 04:52:23 UTC
SVN commit 1128360 by kkofler:

Kompare: Detect malformed diffs and display an error message to the user in that case. Still display what we can display, but tell the user that some lines will be missing.

Tested on Fedora 12, kdelibs 4.4.2.

BUG: 235503

 M  +8 -1      komparemodellist.cpp  
 M  +3 -2      parser.cpp  
 M  +2 -1      parser.h  
 M  +35 -8     parserbase.cpp  
 M  +4 -1      parserbase.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1128360