Fossil SCM

minor cut/paste error

jan.nijtmans 2013-03-03 15:39 trunk
Commit b163569a8c6143c490e959d0929b4ea298a0b91f
1 file changed +2 -4
+2 -4
--- src/diff.c
+++ src/diff.c
@@ -225,14 +225,12 @@
225225
226226
/* Check individual lines.
227227
*/
228228
if( n==0 ) return 1; /* Empty file -> text */
229229
c = *z;
230
+ if( c==0 ) return 0; /* Zero byte in a file -> binary */
230231
j = (c!='\n');
231
- if( c==0 ){
232
- return 0; /* Zero byte in a file -> binary */
233
- }
234232
while( --n>0 ){
235233
c = *++z; ++j;
236234
if( c==0 ) return 0; /* Zero byte in a file -> binary */
237235
if( c=='\n' ){
238236
if( z[-1]=='\r' ){
@@ -337,11 +335,11 @@
337335
flags |= 1; /* Very long line, continue */
338336
}
339337
j = 0;
340338
}
341339
}
342
- if( (flags&1) || (j>LENGTH_MASK) ){
340
+ if( (flags&1) || (j>UTF16_LENGTH_MASK) ){
343341
return -4; /* Very long line -> binary */
344342
}
345343
return 1-flags; /* No problems seen -> not binary */
346344
}
347345
348346
--- src/diff.c
+++ src/diff.c
@@ -225,14 +225,12 @@
225
226 /* Check individual lines.
227 */
228 if( n==0 ) return 1; /* Empty file -> text */
229 c = *z;
 
230 j = (c!='\n');
231 if( c==0 ){
232 return 0; /* Zero byte in a file -> binary */
233 }
234 while( --n>0 ){
235 c = *++z; ++j;
236 if( c==0 ) return 0; /* Zero byte in a file -> binary */
237 if( c=='\n' ){
238 if( z[-1]=='\r' ){
@@ -337,11 +335,11 @@
337 flags |= 1; /* Very long line, continue */
338 }
339 j = 0;
340 }
341 }
342 if( (flags&1) || (j>LENGTH_MASK) ){
343 return -4; /* Very long line -> binary */
344 }
345 return 1-flags; /* No problems seen -> not binary */
346 }
347
348
--- src/diff.c
+++ src/diff.c
@@ -225,14 +225,12 @@
225
226 /* Check individual lines.
227 */
228 if( n==0 ) return 1; /* Empty file -> text */
229 c = *z;
230 if( c==0 ) return 0; /* Zero byte in a file -> binary */
231 j = (c!='\n');
 
 
 
232 while( --n>0 ){
233 c = *++z; ++j;
234 if( c==0 ) return 0; /* Zero byte in a file -> binary */
235 if( c=='\n' ){
236 if( z[-1]=='\r' ){
@@ -337,11 +335,11 @@
335 flags |= 1; /* Very long line, continue */
336 }
337 j = 0;
338 }
339 }
340 if( (flags&1) || (j>UTF16_LENGTH_MASK) ){
341 return -4; /* Very long line -> binary */
342 }
343 return 1-flags; /* No problems seen -> not binary */
344 }
345
346

Keyboard Shortcuts

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