Fossil SCM
Fix the computation of DLink.nw for the case of the -w (no whitespace) option for diff.
Commit
44b6f128453b35039bc261c8aac0e079c06bdedcd9eaac8968cfe39402c9e359
Parent
f6112b93e9bbb7e…
1 file changed
+1
-1
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -275,20 +275,20 @@ | ||
| 275 | 275 | } |
| 276 | 276 | if( (diffFlags & DIFF_IGNORE_ALLWS)==DIFF_IGNORE_ALLWS ){ |
| 277 | 277 | int numws = 0; |
| 278 | 278 | for(s=0; s<k && z[s]<=' '; s++){} |
| 279 | 279 | a[i].indent = s; |
| 280 | + a[i].nw = k - s; | |
| 280 | 281 | for(h=0, x=s; x<k; x++){ |
| 281 | 282 | char c = z[x]; |
| 282 | 283 | if( diff_isspace(c) ){ |
| 283 | 284 | ++numws; |
| 284 | 285 | }else{ |
| 285 | 286 | h = (h^c)*9000000000000000041LL; |
| 286 | 287 | } |
| 287 | 288 | } |
| 288 | 289 | k -= numws; |
| 289 | - a[i].nw = k - s; | |
| 290 | 290 | }else{ |
| 291 | 291 | int k2 = k & ~0x7; |
| 292 | 292 | u64 m; |
| 293 | 293 | for(h=x=s=0; x<k2; x += 8){ |
| 294 | 294 | memcpy(&m, z+x, 8); |
| 295 | 295 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -275,20 +275,20 @@ | |
| 275 | } |
| 276 | if( (diffFlags & DIFF_IGNORE_ALLWS)==DIFF_IGNORE_ALLWS ){ |
| 277 | int numws = 0; |
| 278 | for(s=0; s<k && z[s]<=' '; s++){} |
| 279 | a[i].indent = s; |
| 280 | for(h=0, x=s; x<k; x++){ |
| 281 | char c = z[x]; |
| 282 | if( diff_isspace(c) ){ |
| 283 | ++numws; |
| 284 | }else{ |
| 285 | h = (h^c)*9000000000000000041LL; |
| 286 | } |
| 287 | } |
| 288 | k -= numws; |
| 289 | a[i].nw = k - s; |
| 290 | }else{ |
| 291 | int k2 = k & ~0x7; |
| 292 | u64 m; |
| 293 | for(h=x=s=0; x<k2; x += 8){ |
| 294 | memcpy(&m, z+x, 8); |
| 295 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -275,20 +275,20 @@ | |
| 275 | } |
| 276 | if( (diffFlags & DIFF_IGNORE_ALLWS)==DIFF_IGNORE_ALLWS ){ |
| 277 | int numws = 0; |
| 278 | for(s=0; s<k && z[s]<=' '; s++){} |
| 279 | a[i].indent = s; |
| 280 | a[i].nw = k - s; |
| 281 | for(h=0, x=s; x<k; x++){ |
| 282 | char c = z[x]; |
| 283 | if( diff_isspace(c) ){ |
| 284 | ++numws; |
| 285 | }else{ |
| 286 | h = (h^c)*9000000000000000041LL; |
| 287 | } |
| 288 | } |
| 289 | k -= numws; |
| 290 | }else{ |
| 291 | int k2 = k & ~0x7; |
| 292 | u64 m; |
| 293 | for(h=x=s=0; x<k2; x += 8){ |
| 294 | memcpy(&m, z+x, 8); |
| 295 |