Fossil SCM

Style and comment fixes.

mistachkin 2013-03-10 00:18 trunk
Commit 4368611ba8c0025d9a8a425b656b1d43a97c0f98
1 file changed +4 -3
+4 -3
--- src/checkin.c
+++ src/checkin.c
@@ -914,15 +914,16 @@
914914
Blob fname; /* Relative pathname of the file */
915915
static int allOk = 0; /* Set to true to disable this routine */
916916
917917
if( allOk ) return 0;
918918
fUnicode = starts_with_utf16_bom(p, 0, 0);
919
- if (fUnicode) {
919
+ if( fUnicode ){
920920
eType = looks_like_utf16(p, &lookFlags);
921
- if ( lookFlags&LOOK_ODD ){
922
- /* It cannot be unicode, so try again as single-byte encoding */
921
+ if( lookFlags&LOOK_ODD ){
922
+ /* Content with an odd number of bytes cannot be UTF-16. */
923923
fUnicode = 0;
924
+ /* Therefore, check if the content appears to be UTF-8. */
924925
eType = looks_like_utf8(p, &lookFlags);
925926
}
926927
}else{
927928
eType = looks_like_utf8(p, &lookFlags);
928929
}
929930
--- src/checkin.c
+++ src/checkin.c
@@ -914,15 +914,16 @@
914 Blob fname; /* Relative pathname of the file */
915 static int allOk = 0; /* Set to true to disable this routine */
916
917 if( allOk ) return 0;
918 fUnicode = starts_with_utf16_bom(p, 0, 0);
919 if (fUnicode) {
920 eType = looks_like_utf16(p, &lookFlags);
921 if ( lookFlags&LOOK_ODD ){
922 /* It cannot be unicode, so try again as single-byte encoding */
923 fUnicode = 0;
 
924 eType = looks_like_utf8(p, &lookFlags);
925 }
926 }else{
927 eType = looks_like_utf8(p, &lookFlags);
928 }
929
--- src/checkin.c
+++ src/checkin.c
@@ -914,15 +914,16 @@
914 Blob fname; /* Relative pathname of the file */
915 static int allOk = 0; /* Set to true to disable this routine */
916
917 if( allOk ) return 0;
918 fUnicode = starts_with_utf16_bom(p, 0, 0);
919 if( fUnicode ){
920 eType = looks_like_utf16(p, &lookFlags);
921 if( lookFlags&LOOK_ODD ){
922 /* Content with an odd number of bytes cannot be UTF-16. */
923 fUnicode = 0;
924 /* Therefore, check if the content appears to be UTF-8. */
925 eType = looks_like_utf8(p, &lookFlags);
926 }
927 }else{
928 eType = looks_like_utf8(p, &lookFlags);
929 }
930

Keyboard Shortcuts

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