Commits
- Commit:
ed9312f04bcebc7aee4f7e7d96d6ec467cb9bb66
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix accounting for line endings in CRLF files
There are two different subtles error in computing the end of line in
diff_data_atomize_text_lines (one in per implementation, _fd and _mmap)
that causes the '\n' of the '\r\n' case to be left out the current line.
It causes strange bugs when diffing CRLF files, such as printing the
"\ No newline at end of file" marker very often and showing the wrong
offsets in the hunk headers.
ok stsp@
- Commit:
e51ebd83fa731d197ee4074ee2e94dbc0581078c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
handle binary files like diff(1) does; new -a option forces text
- Commit:
29916bb6c0c248ca6fa5486cb9e081d92112e86c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
expose struct diff_atom in public API for external atomizer implementations
- Commit:
fe6d58fb52ea8d1041a8eb65e28a04816df67c08
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
add a missing include for uint8_t and switch from <inttypes.h> to <stdint.h>
ok millert stsp
- Commit:
c16dde50bb5e92533dcbbc513875d726f0f9dd48
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow diff API users to atomize files separately
This is a breaking API change (not that we care about that at this point).
This can avoid redundant work spent on atomizing a file multiple times.
There are use cases where one particular file must be compared to other
files over and over again, such as when blaming file history.
The old API gave access to both versions of the file to the atomizer just
in case a future atomizer implementation needs this. This can still be
achieved by passing a second file via the atomizer's private data pointer.
- Commit:
845f35754a8e7935c62f11f48d5dedd536a0615c
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
reflect ignore-whitespace in atom hash
- Commit:
ca85e8bc8fc561d9c93cf1c7d59b4ac8a25f94c1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix off-by-one in the off-by-one fix made in bdfcb086
- Commit:
bdfcb0869a9b731044cf3b1acc797a805dd8eed9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
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>
- Commit:
40dba3d841ef97bc452f734f6945dff48bc2f925
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
revert 1ea185225fc4897fdfbe0043837b43ddab3f1449 which caused an infinite loop
- Commit:
1ea185225fc4897fdfbe0043837b43ddab3f1449
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a segfault: d->data may point to "", this cannot be checked for NULL
- Commit:
ad5b3f855591bc548f15e09ae4b7fdf674f16245
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
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.
- Commit:
1dfba0555efd6b616811906d011f96945be90dcc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move headers from include/diff/ to include/; makes things easier for consumers
- Commit:
2a1b94d029d73b14949971a9f159da4670584ee9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
repair DEBUG build
- Commit:
85ab45596727cfd0254c6d5b6f0c5705b7b6e89e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move some definitions from the public diff_main.h to an internal header file
- Commit:
7a54ad3ae5d25aa5349668c8d3d3fa048a8f0733
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use buffered stdio if falling back on file i/o; this is much faster
- Commit:
03f497279db41e42ac287a15df9f9e03c4c83fd2
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
return error instead of abort()
- Commit:
e4464189bc895121565a7a02eef98262343e6e24
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
rename 'debug.h' to 'diff_debug.h'
- Commit:
e10a628aa1d46df600ffc7194d35f67416eaefdd
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
avoid include statements in header files; make each .c pull in what's needed
- Commit:
3e6cba3a54789e151b37851eef9cdccc4180ae40
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
replace enum diff_rc errors with plain errno values
- Commit:
c6eecea3241f36efced72dc3b7c5b023c89e1c4a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fall back on file i/o in case an input file cannot be memory-mapped
- Commit:
0d27172a828e5ff3c6457cbf0d36a88c9bd8e370
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
KNF: use max 80 columns
- Commit:
61a7b57805472a03ad39d7bf4ef6d705eb0ccac2
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
KNF: function declaration return types on separate line
- Commit:
826c8cf15933d99e93bcb7940c826773c4d34f86
- From:
- Martin Pieuchot <mpi@openbsd.org>
- Via:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
Kill unused variables
- Commit:
3b0f3d6191103b52a0619ed00752f7f5e6fa754c
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
initial commit