madeye/shadowsocks-libev — pull request #116 by boytm (2014-09-16 06:19:07+00:00)
Title: On Windows, read CRLF ending file exist some problem that tested by MinG...

...W and VS2008.

1)open CRLF ending file in text mode
2)
fseek(f, 0, SEEK_END);
long pos = ftell(f); // return the file total byte
fseek(f, 0, SEEK_SET);
3)
int nread = fread(buf, pos, 1, f); // always return 0 to nread
int nread = fread(buf, 1, pos, f); // return readed byte with CRLF converted to LF. it means pos - nread = CRLF's count.