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
Merge pull request #7220 from tkelman/patch-4

fix #7203 and #7218