cppp-reiconv
cppp-reiconv copied to clipboard
assert_compare_file() function issue
I think to correctly calculate an inequality position between two files you should use
if(file2_c == '\r') { file1.unget(); --read_seek; continue; } instead
if(file2_c == '\r') { file1.unget(); continue; }
otherwise, the position shown is shifted by the number of previous '\r's in a file, passed to a checking utility. (example : check-stateless data cp1251)
This is a problem. read_seek is for record the position when a difference has been found. But if we ignore CR, The real position of the difference will be different. So I plan to use the position in file1. I'm not very good at algorithms. I think the read_seek without --read_seek is the real posiation of the difference in file1.
@wiluite