| author | Junio C Hamano <junio@pobox.com> | |
| Wed, 2 Jan 2008 09:50:11 +0000 (01:50 -0800) | ||
| committer | Junio C Hamano <gitster@pobox.com> | |
| Mon, 7 Jan 2008 06:44:44 +0000 (22:44 -0800) | ||
| commit | 23707811c56a7756cbd6188e510f0a486c35c929 | |
| tree | 013ac44e706c265e2543c5afca53dad4afefe591 | tree | snapshot |
| parent | 44b25b872f926ba92bae9ddf2495e7f59d0c96e2 | commit | diff |
diff: do not chomp hunk-header in the middle of a character
We truncate hunk-header line at 80 bytes, but that 80th byte
could be in the middle of a character, which is bad. This uses
pick_one_utf8_char() function to make sure we do not cut a character
in the middle.
This assumes that the internal representation of the text is
UTF-8. This needs to be extended in the future but the optimal
direction has not been decided yet.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We truncate hunk-header line at 80 bytes, but that 80th byte
could be in the middle of a character, which is bad. This uses
pick_one_utf8_char() function to make sure we do not cut a character
in the middle.
This assumes that the internal representation of the text is
UTF-8. This needs to be extended in the future but the optimal
direction has not been decided yet.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| diff.c | diff | blob | history | |
| t/t4025-hunk-header.sh | [new file with mode: 0755] | blob |