Menu

#142 output varies dependant upon order of file comparison

open
nobody
None
7
2015-04-17
2010-07-01
No

The program outputs different results dependent upon the order of file comparison. See attachments...

Discussion

  • keystoneclimber

    keystoneclimber - 2010-07-01

    comparison files and screenshots of bug

     
  • Thomas Klimpel

    Thomas Klimpel - 2015-04-17

    The bug is in the following function:

    // My own diff-invention:
    template <class t="">
    void calcDiff( const T p1, int size1, const T p2, int size2, DiffList& diffList, int match, int maxSearchRange )</class>

    The attached bug.cpp has extracted this function, and added a short "testCalcDiff" function and a short main program that uses "testCalcDiff" to demonstrate the bug. The fix is also there, just change "#if 0" to "#if 1". I suggest to go through both versions with your favorite debugger, to understand the bug and the proposed fix.

     
MongoDB Logo MongoDB