Use system specific line separator

I replaced the hard-coded #"\n" with a call to get the system line separator, otherwise the code fails on lines ending with "\r\n" as was the case with me (GNU Emacs on Windows).