Convert all line endings to LF before writing the generated code to file.
authorUlya Trofimovich <skvadrik@gmail.com>
Fri, 11 Nov 2016 13:54:33 +0000 (13:54 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Fri, 11 Nov 2016 13:54:33 +0000 (13:54 +0000)
commita51c7c858c99641d473bfbb375b082605f74f83b
tree5344b98f7c42ca0208b9ce8e2af678e5d0a4b562
parent54b50c0bbfe4a865bf004ef51fb639156a7657d7
Convert all line endings to LF before writing the generated code to file.

This commit should fix bug #163 reported by pauloscustodio:
    Reading files with "rb" causes issues in Windows

re2c reads input files in binary mode and writes the generated output in
text mode. This caused CR LF conversion to CR CR LF on Windows: first CR
comes from reading input in binary mode, second CR is added when writing
output in text mode. This only happened to those parts of input which are
not transformed by re2c: we used to copy-paste verbatim, now we patch line
endings.
re2c/src/codegen/output.cc