Fossil SCM
One more off-by-one error.
Commit
1484625d6ea360e9a97a24e382da210a528c07d8
Parent
fa506944056737f…
1 file changed
+1
-1
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -365,11 +365,11 @@ | ||
| 365 | 365 | flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */ |
| 366 | 366 | }else if( c==0 ){ |
| 367 | 367 | flags |= LOOK_NUL; /* NUL character in a file -> binary */ |
| 368 | 368 | }else if( c=='\r' ){ |
| 369 | 369 | flags |= LOOK_CR; |
| 370 | - if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){ | |
| 370 | + if( n<2*sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){ | |
| 371 | 371 | flags |= LOOK_LONE_CR; /* More chars, next char is not LF */ |
| 372 | 372 | } |
| 373 | 373 | } |
| 374 | 374 | while( 1 ){ |
| 375 | 375 | int c2 = c; |
| 376 | 376 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */ |
| 366 | }else if( c==0 ){ |
| 367 | flags |= LOOK_NUL; /* NUL character in a file -> binary */ |
| 368 | }else if( c=='\r' ){ |
| 369 | flags |= LOOK_CR; |
| 370 | if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){ |
| 371 | flags |= LOOK_LONE_CR; /* More chars, next char is not LF */ |
| 372 | } |
| 373 | } |
| 374 | while( 1 ){ |
| 375 | int c2 = c; |
| 376 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */ |
| 366 | }else if( c==0 ){ |
| 367 | flags |= LOOK_NUL; /* NUL character in a file -> binary */ |
| 368 | }else if( c=='\r' ){ |
| 369 | flags |= LOOK_CR; |
| 370 | if( n<2*sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){ |
| 371 | flags |= LOOK_LONE_CR; /* More chars, next char is not LF */ |
| 372 | } |
| 373 | } |
| 374 | while( 1 ){ |
| 375 | int c2 = c; |
| 376 |