Fossil SCM

One more off-by-one error.

jan.nijtmans 2013-05-13 09:21 trunk
Commit 1484625d6ea360e9a97a24e382da210a528c07d8
1 file changed +1 -1
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -365,11 +365,11 @@
365365
flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
366366
}else if( c==0 ){
367367
flags |= LOOK_NUL; /* NUL character in a file -> binary */
368368
}else if( c=='\r' ){
369369
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' ){
371371
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
372372
}
373373
}
374374
while( 1 ){
375375
int c2 = c;
376376
--- 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

Keyboard Shortcuts

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