Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: ace214 on October 16, 2006, 10:04:01 PM

Title: patching- what's fuzz?
Post by: ace214 on October 16, 2006, 10:04:01 PM
what is the "fuzz" when applying patches?
Title: Re: patching- what's fuzz?
Post by: LinusN on October 17, 2006, 01:42:07 AM
It's when the patch program manages to apply the patch, even though the line numbers don't match exactly.
Title: Re: patching- what's fuzz?
Post by: ace214 on October 18, 2006, 07:04:21 PM
then what's the difference between that and offset?
Title: Re: patching- what's fuzz?
Post by: LinusN on October 19, 2006, 01:33:29 AM
A patch file contains both line number info and a context, i.e a few lines from the original file to help synchronize if the original file has changes slightly.

If goes to the line number stated in the patch file and looks up and down in the file for lines matching the context of the hunk. If it doesn't find a match, it removes the first and last line of the context and tries again. The number of lines removed is the "fuzz factor". If it finds a match, it remembers the line offset and applies it to the next hunk.

Clear as mud, no? :-)