Fossil SCM
Minor tweak to the side-by-side alignment algorithm so that it handles pure white-space lines better.
Commit
312590a9ee6040fd5881fe70ef217b9dfb44e7fb
Parent
e0565d43513cbef…
1 file changed
+1
-1
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -555,11 +555,11 @@ | ||
| 555 | 555 | while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; } |
| 556 | 556 | while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; } |
| 557 | 557 | while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; } |
| 558 | 558 | while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; } |
| 559 | 559 | avg = (nA+nB)/2; |
| 560 | - if( avg==0 ) return 100; | |
| 560 | + if( avg==0 ) return 0; | |
| 561 | 561 | best = 0; |
| 562 | 562 | for(i=0; i<nA-best; i++){ |
| 563 | 563 | char c = zA[i]; |
| 564 | 564 | for(j=0; j<nB-best; j++){ |
| 565 | 565 | if( c!=zB[j] ) continue; |
| 566 | 566 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -555,11 +555,11 @@ | |
| 555 | while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; } |
| 556 | while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; } |
| 557 | while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; } |
| 558 | while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; } |
| 559 | avg = (nA+nB)/2; |
| 560 | if( avg==0 ) return 100; |
| 561 | best = 0; |
| 562 | for(i=0; i<nA-best; i++){ |
| 563 | char c = zA[i]; |
| 564 | for(j=0; j<nB-best; j++){ |
| 565 | if( c!=zB[j] ) continue; |
| 566 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -555,11 +555,11 @@ | |
| 555 | while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; } |
| 556 | while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; } |
| 557 | while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; } |
| 558 | while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; } |
| 559 | avg = (nA+nB)/2; |
| 560 | if( avg==0 ) return 0; |
| 561 | best = 0; |
| 562 | for(i=0; i<nA-best; i++){ |
| 563 | char c = zA[i]; |
| 564 | for(j=0; j<nB-best; j++){ |
| 565 | if( c!=zB[j] ) continue; |
| 566 |