Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch utf16Bom Excluding Merge-Ins
This is equivalent to a diff from a98467b661 to 1e70f211f9
2013-02-18
| ||
13:46 | Fixed ticket [5df2715635b99bd46a] (check-in count mismatch). check-in: b27c0d6d3f user: stephan tags: trunk | |
10:03 | New function fossil_utf8_to_filename, such that fossil_unicode_to_utf8/fossil_utf8_to_unicode/fossil_unicode_free are not used on UNIX/MAC any more: On UNIX those 3 functions were only no-ops, but this allows to re-implement then for real unicode <-> utf-8 conversions. There is an "#ifdef _WIN32" around those 3 functions and 2 more (fossil_mbcs_to... Leaf check-in: cc3976fd30 user: jan.nijtmans tags: fossil_utf8_to_filename | |
08:30 | merge trunk Leaf check-in: fdd51b617c user: jan.nijtmans tags: ticket-d17d6e5b17 | |
2013-02-17
| ||
21:37 | merge trunk Leaf check-in: fdf9050c4b user: jan.nijtmans tags: improve_commit_warning | |
14:47 | More simplification in UTF-16 bom detection Leaf check-in: 1e70f211f9 user: jan.nijtmans tags: utf16Bom | |
14:43 | Remove two unused variables check-in: a98467b661 user: jan.nijtmans tags: trunk | |
2013-02-16
| ||
14:12 | Limit the complexity of the diff display on check-in information pages. check-in: 4f95ea8c56 user: drh tags: trunk | |
Changes to src/diff.c.
368 368 ** or in reversed byte order. 369 369 */ 370 370 int starts_with_utf16_bom( 371 371 const Blob *pContent, /* IN: Blob content to perform BOM detection on. */ 372 372 int *pnByte, /* OUT: The number of bytes used for the BOM. */ 373 373 int *pbReverse /* OUT: Non-zero for BOM in reverse byte-order. */ 374 374 ){ 375 - const char *z = blob_buffer(pContent); 376 - int bomSize = 2; 375 + const unsigned short *z = (unsigned short *)blob_buffer(pContent); 376 + const int bomSize = 2; 377 377 static const unsigned short bom = 0xfeff; 378 378 static const unsigned short bom_reversed = 0xfffe; 379 - static const unsigned short null = 0; 380 - int size; 379 + int size = blob_size(pContent); 381 380 382 381 if( pnByte ) *pnByte = bomSize; 383 382 if( pbReverse ) *pbReverse = -1; /* Unknown. */ 384 - size = blob_size(pContent); 385 - if( (size<bomSize) || (size%2) ) return 0; 386 - if( memcmp(z, &bom_reversed, bomSize)==0 ){ 383 + if( (size<bomSize) || (size%2) 384 + || (size>=(2*bomSize) && z[1]==0) ) return 0; 385 + if( z[0] == bom_reversed ){ 387 386 if( pbReverse ) *pbReverse = 1; 388 - if( size<(2*bomSize) ) return 1; 389 - if( memcmp(z+bomSize, &null, bomSize)!=0 ) return 1; 390 - }else if( memcmp(z, &bom, bomSize)==0 ){ 387 + }else if( z[0] == bom ){ 391 388 if( pbReverse ) *pbReverse = 0; 392 - if( size<(2*bomSize) ) return 1; 393 - if( memcmp(z+bomSize, &null, bomSize)!=0 ) return 1; 394 389 } 395 390 return 0; 396 391 } 397 392 398 393 /* 399 394 ** Return true if two DLine elements are identical. 400 395 */