Fossil

Check-in [0ccbb44f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:style fix
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | improve_looks_like_binary
Files: files | file ages | folders
SHA1: 0ccbb44f14790cb12f622fc0287e44f771b01ba9
User & Date: jan.nijtmans 2012-11-01 11:52:53
Context
2012-11-01
14:49
Add back checks for FFFE and FFFF in looks_like_text:
- FFFE is a reversed BOM. It could arise when an UTF-16LE and an UTF-16BE file are concatenated. This is always a fatal error, so diff should bail out early.
- FFFF is a permanently unassigned character as well, which doesn't exist in any font. Sometimes uninitialized variables are either initialized with 0000 or FFFF, so this makes it much more likely that binary files are detected early.

The earlier check for FEFF was not sensible: A BOM in the middle of an UTF-16 file could easily arise when two UTF-16LE or twe UTF-16BE files are concatenated. Nothing goes wrong in that case, the BOM should just be displayed a zero-width-space. Therefore, diff should not bail out.

check-in: 64868f2b user: jan.nijtmans tags: improve_looks_like_binary
11:52
style fix check-in: 0ccbb44f user: jan.nijtmans tags: improve_looks_like_binary
11:48
merge trunk

let looks_like_text() give different values for UTF-16 BE/LE. Not used yet.

check-in: 348637de user: jan.nijtmans tags: improve_looks_like_binary
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
    }else{
      zWarning = "Unicode";
    }
    file_relative_name(zFilename, &fname, 0);
    blob_zero(&ans);
    zMsg = mprintf(
         "%s contains %s.  commit anyhow (a=all/y/N)? ",
         blob_str(&fname), zWarning );
    prompt_user(zMsg, &ans);
    fossil_free(zMsg);
    cReply = blob_str(&ans)[0];
    if( cReply=='a' || cReply=='A' ){
      allOk = 1;
    }else if( cReply!='y' && cReply!='Y' ){
      fossil_fatal("Abandoning commit due to %s in %s",
                   zWarning , blob_str(&fname));
    }
    blob_reset(&ans);
    blob_reset(&fname);
  }
}

/*







|







|







908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
    }else{
      zWarning = "Unicode";
    }
    file_relative_name(zFilename, &fname, 0);
    blob_zero(&ans);
    zMsg = mprintf(
         "%s contains %s.  commit anyhow (a=all/y/N)? ",
         blob_str(&fname), zWarning);
    prompt_user(zMsg, &ans);
    fossil_free(zMsg);
    cReply = blob_str(&ans)[0];
    if( cReply=='a' || cReply=='A' ){
      allOk = 1;
    }else if( cReply!='y' && cReply!='Y' ){
      fossil_fatal("Abandoning commit due to %s in %s",
                   zWarning, blob_str(&fname));
    }
    blob_reset(&ans);
    blob_reset(&fname);
  }
}

/*