Changeset 1319 for proto


Ignore:
Timestamp:
Aug 18, 2011, 11:07:20 AM (8 years ago)
Author:
cameron
Message:

Correct error check for final SOH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/FIX/fix.py

    r1316 r1319  
    4949        # Assume for now that all SOHs are field separators, not data.
    5050        # Use negated SOH stream to shift in a 1 at start-of-file.
    51         # shift out a 0 at end of file.
    52         msg_starts = ~bitutil.Advance(~fix_lex.SOH)
    53         error1 = msg_starts &~ allowed_leading_digit
     51        starts = ~bitutil.Advance(~fix_lex.SOH)
     52        EOF_pos = bitutil.Advance(EOF_mask) &~ EOF_mask
     53        msg_starts = starts & EOF_mask
     54        error1 = EOF_pos &~ starts
     55        error2 = msg_starts &~ allowed_leading_digit
    5456        field_ends = bitutil.ScanThru(msg_starts, fix_lex.Digit)
    55         error2 = field_ends &~ fix_lex.Equals
    56         error = error1 | error2
     57        error3 = field_ends &~ fix_lex.Equals
     58        error = error1 | error2 | error3
    5759        if error:
    5860                error_tracker.NoteError("Potential error in header field", error)
Note: See TracChangeset for help on using the changeset viewer.