@matheusbsbs / matheus-bagliano / commits / d281786fcd
Fork 0

xdiff: minor changes to match libxdiff-0.21

This reformats the change 621c53cc082299eaf69e9f2dc0274547c7d87fb0 introduced to match what upstream author implemented in libxdiff-0.21 without changing any logic (hopefully ;-). This is to help keep us in sync with the upstream. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jun 19, 2006 at 17:01 UTC d281786fcd6d0df47dd46e415f1a804b2e81ed9b
2 files changed +5 -7
xdiff/xutils.c
+4 -7
@@ -44,21 +44,18 @@ long xdl_bogosqrt(long n) {
44
45 int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
46 xdemitcb_t *ecb) {
47 + int i = 2;
48 mmbuffer_t mb[3];
48 - int i;
49
50 mb[0].ptr = (char *) pre;
51 mb[0].size = psize;
52 mb[1].ptr = (char *) rec;
53 mb[1].size = size;
54 - i = 2;
55 -
56 - if (!size || rec[size-1] != '\n') {
57 - mb[2].ptr = "\n\\ No newline at end of file\n";
54 + if (size > 0 && rec[size - 1] != '\n') {
55 + mb[2].ptr = (char *) "\n\\ No newline at end of file\n";
56 mb[2].size = strlen(mb[2].ptr);
59 - i = 3;
57 + i++;
58 }
61 -
59 if (ecb->outf(ecb->priv, mb, i) < 0) {
60
61 return -1;
xdiff/xutils.h
+1
@@ -24,6 +24,7 @@
24 #define XUTILS_H
25
26
27 +
28 long xdl_bogosqrt(long n);
29 int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
30 xdemitcb_t *ecb);