Commits


rename diff_atom->d to diff_atom->root, because it always is The idea was that for each diff box within the files, the atoms would have a backpointer to the current layer of diff_data (indicating the current section), but it is not actually needed to update the backpointer in each atom to the current diff_data. That is why the current code always points atom->d to the root diff_data for the entire file. Clarify by proper name. Constructs like atom->d->root->foo are redundant, just use atom->root->foo.


diff_main: don't run algo if left or right are empty


debug: fix logging first chunk


diff_algo_none: cosmetics


fix diff_algo_none() for ending in plus chunk


results: also combine chunks coming from temp_chunks


fix diff_algo_none(): no NULL pointers for left_start and right_start


diff_state_add_chunk(): fix adding minus above plus chunk: wrong idx


debug tweaks for diff_state_add_chunk()


diff_algo_none(): also detect equal lines at the end


cosmetic: diff_algo_none(): rename to equal_lines_start


cosmetic: diff_algo_none: local pointers for shorter code


move headers from include/diff/ to include/; makes things easier for consumers


repair DEBUG build


convert 'ignore_whitespace' boolean into a more general flags argument


move some definitions from the public diff_main.h to an internal header file


fix segfault which occurred with empty input files


use buffered stdio if falling back on file i/o; this is much faster


reduce default diff-box recursion depth from 1024 to 32


rename 'debug.h' to 'diff_debug.h'


add support for ignoring whitespace (-w option) Tests grow the ability to call diff with options. Options to use are encoded in the test file name as a single dash followed by a string of option letters. E.g. -wp for 'ignore whitespace' and 'do patience'


diff result: ensure sane order of result chunks Ensure that a adjacent chunks of same type are combined, and that a minus block always precedes an adjacent plus block. The upcoming myers-divide optimization is prone to produce weird ordering of plus and minus chunks.


add diff_atom_cmp() and error handling to diff_atom_same()


avoid include statements in header files; make each .c pull in what's needed


replace enum diff_rc errors with plain errno values