Handle dos files with \r

Signed-off-by: Bao Haojun <baohaojun@gmail.com>