fix #7203 and #7218

for Windows users who have git configured with \r\n line endings,
or modify the source in an editor that always uses \r\n