Fossil SCM

Minor bug-fix when using -w or -Z flag in diff logic. Make sure that the common lines printed in a diff always come from the left-side, it might be that the right-side is different by white-space only.

jan.nijtmans 2014-03-07 20:14 trunk
Commit d38f0ce7597cc9afbf8dbd242fa07e0eec6f94a1
1 file changed +2 -2
+2 -2
--- src/diff.c
+++ src/diff.c
@@ -427,11 +427,11 @@
427427
b += m;
428428
if( i<nr-1 ){
429429
m = R[r+i*3+3];
430430
for(j=0; j<m; j++){
431431
if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
432
- appendDiffLine(pOut, ' ', &B[b+j], html, 0);
432
+ appendDiffLine(pOut, ' ', &A[a+j], html, 0);
433433
}
434434
b += m;
435435
a += m;
436436
}
437437
}
@@ -440,11 +440,11 @@
440440
assert( nr==i );
441441
m = R[r+nr*3];
442442
if( m>nContext ) m = nContext;
443443
for(j=0; j<m; j++){
444444
if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
445
- appendDiffLine(pOut, ' ', &B[b+j], html, 0);
445
+ appendDiffLine(pOut, ' ', &A[a+j], html, 0);
446446
}
447447
}
448448
}
449449
450450
/*
451451
--- src/diff.c
+++ src/diff.c
@@ -427,11 +427,11 @@
427 b += m;
428 if( i<nr-1 ){
429 m = R[r+i*3+3];
430 for(j=0; j<m; j++){
431 if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
432 appendDiffLine(pOut, ' ', &B[b+j], html, 0);
433 }
434 b += m;
435 a += m;
436 }
437 }
@@ -440,11 +440,11 @@
440 assert( nr==i );
441 m = R[r+nr*3];
442 if( m>nContext ) m = nContext;
443 for(j=0; j<m; j++){
444 if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
445 appendDiffLine(pOut, ' ', &B[b+j], html, 0);
446 }
447 }
448 }
449
450 /*
451
--- src/diff.c
+++ src/diff.c
@@ -427,11 +427,11 @@
427 b += m;
428 if( i<nr-1 ){
429 m = R[r+i*3+3];
430 for(j=0; j<m; j++){
431 if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
432 appendDiffLine(pOut, ' ', &A[a+j], html, 0);
433 }
434 b += m;
435 a += m;
436 }
437 }
@@ -440,11 +440,11 @@
440 assert( nr==i );
441 m = R[r+nr*3];
442 if( m>nContext ) m = nContext;
443 for(j=0; j<m; j++){
444 if( showLn ) appendDiffLineno(pOut, a+j+1, b+j+1, html);
445 appendDiffLine(pOut, ' ', &A[a+j], html, 0);
446 }
447 }
448 }
449
450 /*
451

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button