#365 Change binary-file detection (look only for zeros)

closed-accepted
5
2003-11-30
2003-10-16
Kimmo Varis
No

So, let's change binary-file detection to look only for
zeros?

There seems to be text files with ascii chars 0x01 -
0x08 too.

Laoran, do you want to apply this to your next
experimental?

--- CVS\WinMerge\files.cpp Fri Oct 10 13:37:18 2003
+++Dev\WinMerge\files.cpp Thu Oct 16 20:46:14 2003
@@ -249,7 +249,7 @@
ch = 0;
}
// Binary check
- if (ch < 0x09)
+ if (ch == 0x00)
{
bBinary = TRUE;
break;

Discussion

  • ganier

    ganier - 2003-10-18

    Logged In: YES
    user_id=804270

    I saw this too late for 2.1.3.1.
    Experimental 2.1.3.2 is available and includes this patch.

     
  • Kimmo Varis

    Kimmo Varis - 2003-10-21
    • status: open --> open-accepted
     
  • Kimmo Varis

    Kimmo Varis - 2003-10-21
    • assigned_to: nobody --> kimmov
    • summary: Change binary-file detection (look only for zeros)
      --> Change binary-file detection (look only for zeros)
     
  • Kimmo Varis

    Kimmo Varis - 2003-10-21

    Logged In: YES
    user_id=631874

    I think this is the way we want to go. At least we don't get
    false positives for binaries.

    Applied to 2.1. Leaving open for applying later to 2.0 branch.

    Checking in files.cpp;
    /cvsroot/winmerge/WinMerge/files.cpp,v <-- files.cpp
    new revision: 1.16; previous revision: 1.15
    done

     
  • Kimmo Varis

    Kimmo Varis - 2003-11-30
    • status: open-accepted --> closed-accepted
     
  • Kimmo Varis

    Kimmo Varis - 2003-11-30

    Logged In: YES
    user_id=631874

    Applied to 2.0 branch. Closing.

    Checking in files.cpp;
    /cvsroot/winmerge/WinMerge/files.cpp,v <-- files.cpp
    new revision: 1.3.2.2; previous revision: 1.3.2.1
    done

     

Log in to post a comment.