stevepettifer/COMP101 — pull request #1 by pwaring (2014-07-15 09:58:10+00:00)
Title: Fix logic bug when resuming script

Next sequence is incremented every time a larger value is found. As a result, the script will duplicate sequence numbers if the highest one is even.

Example: If highest sequence is 2:
a) nextseq = 0
b) int(fullseq[1]) > nextseq - true
c) nextseq = 1
d) nextseq += 1, therefore nextseq = 2
e) int(fullseq[1]) > nextseq - false (2 is not greater than 2)
f) nextseq starts at 2, even though an entry exists for that sequence number

Instead the script should find the largest sequence and only increment once the entire file has been processed. Effectively the increment is moved outside the if block and for loop.