Commits


reflect ignore-whitespace in atom hash


fix off-by-one in the off-by-one fix made in bdfcb086


fix off-by-one access beyond mapped file in diff_data_atomize_text_lines_mmap() Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000013992a89eca in diff_data_atomize_text_lines_mmap (d=0x13b9b455668) \ at /home/stsp/src/got/got/../lib/diff_atomize_text.c:134 134 if (line_end[0] == '\r' (gdb) p pos $1 = (const uint8_t *) 0x13be402006d "" (gdb) p end $2 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000> (gdb) p end-1 $3 = (const uint8_t *) 0x13be4022fff "" (gdb) p line_end $4 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000>


revert 1ea185225fc4897fdfbe0043837b43ddab3f1449 which caused an infinite loop


fix a segfault: d->data may point to "", this cannot be checked for NULL


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.


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


repair DEBUG build


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


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


return error instead of abort()


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


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


replace enum diff_rc errors with plain errno values


fall back on file i/o in case an input file cannot be memory-mapped


KNF: use max 80 columns


KNF: function declaration return types on separate line


Kill unused variables


initial commit