summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-06-19 18:47:29 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-06-19 18:47:29 -0700
commitb19beecd9456a2e6282634e5df751206b972604a (patch)
tree52617650de39f12bbeb351acf7fb5c9b5becf5cb /xdiff
parentMerge branches 'js/lsfix', 'pb/config' and 'jn/web' into next (diff)
parentAdd "named object array" concept (diff)
downloadtgif-b19beecd9456a2e6282634e5df751206b972604a.tar.xz
Merge branch 'lt/objlist' into next
* lt/objlist: Add "named object array" concept xdiff: minor changes to match libxdiff-0.21 fix rfc2047 formatter. Fix t8001-annotate and t8002-blame for ActiveState Perl Add specialized object allocator
Diffstat (limited to 'xdiff')
-rw-r--r--xdiff/xutils.c11
-rw-r--r--xdiff/xutils.h1
2 files changed, 5 insertions, 7 deletions
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 21ab8e7e26..f91b403475 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -44,21 +44,18 @@ long xdl_bogosqrt(long n) {
int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
xdemitcb_t *ecb) {
+ int i = 2;
mmbuffer_t mb[3];
- int i;
mb[0].ptr = (char *) pre;
mb[0].size = psize;
mb[1].ptr = (char *) rec;
mb[1].size = size;
- i = 2;
-
- if (!size || rec[size-1] != '\n') {
- mb[2].ptr = "\n\\ No newline at end of file\n";
+ if (size > 0 && rec[size - 1] != '\n') {
+ mb[2].ptr = (char *) "\n\\ No newline at end of file\n";
mb[2].size = strlen(mb[2].ptr);
- i = 3;
+ i++;
}
-
if (ecb->outf(ecb->priv, mb, i) < 0) {
return -1;
diff --git a/xdiff/xutils.h b/xdiff/xutils.h
index ea38ee903f..08691a2447 100644
--- a/xdiff/xutils.h
+++ b/xdiff/xutils.h
@@ -24,6 +24,7 @@
#define XUTILS_H
+
long xdl_bogosqrt(long n);
int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
xdemitcb_t *ecb);