cppp-reiconv icon indicating copy to clipboard operation
cppp-reiconv copied to clipboard

assert_compare_file() function issue

Open wiluite opened this issue 2 years ago • 2 comments

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)

wiluite avatar Oct 27 '23 08:10 wiluite

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.

ChenPi11 avatar Nov 18 '23 11:11 ChenPi11

@wiluite

ChenPi11 avatar Nov 20 '23 09:11 ChenPi11