[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn diff" crashes when binary files differ

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-02-25 22:19:31 CET

Sander Striker wrote:

>>From: Sander Striker [mailto:striker@apache.org]
>>Sent: Tuesday, February 25, 2003 1:39 AM
>>It's a different bug. It's real simple, '\n' is never encountered in
>>the binary data before a '\0'. I'll rehash the svn_diff_file token
>>stuff to account for this tomorrow. Might aswell switch to mmapping
>>then too. Anyhow, this bug shows it's ugly head because we are running
>>text diff on binary data, which shouldn't happen in the first place.
>>I thought we had an issue on this which was already closed, but am
>>not sure.
>Hmpf, it seems that this _is_ a showstopper now, since we don't do
>any checking in the svn_diff_file to see if the input files are binary.
>svn_diff_file is supposed to be called for line based diffs, you see.
>We could add the same checking in libsvn_client/diff.c as we have in
>libsvn_wc/merge.c (the latter handles binary by marking it as a conflict
>by default).
+1. We should never, ever try to diff files that are marked as binary.


I think we should only do the prop-based check. Scanning the complete
file for bad characters isn't a good idea. So the diff code has to
handle diffs on binary files gracefully -- i.e., it shouldn't crash. But
it can tell the user to go eff himself.

Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 25 22:20:17 2003

This is an archived mail posted to the Subversion Dev mailing list.