Skip to content
Snippets Groups Projects
  • Sébastien Villemot's avatar
    487c3729
    Macroprocessor: fix newlines in output when under Windows and input uses CR+LF convention · 487c3729
    Sébastien Villemot authored
    If the input .mod file uses CR+LF convention, and if the user is under Windows,
    then the output of the macroprocessor (as given by the “savemacro” option) had
    incorrect end of lines: those would be CR+CR+LF.
    
    The reason is that some TextNode(s) internally created by the macroprocessor
    would themselves contain CR+LF sequences, which would then be transformed into
    CR+CR+LF in the output (because MinGW transforms LF into CR+LF in output
    streams).
    
    The fix consists in changing the nature of the EOL token: the parsed text is no
    longer attached to it, so that the Bison file now systematically turns it into
    a LF inside TextNode(s).
    
    Closes: #80
    487c3729
    History
    Macroprocessor: fix newlines in output when under Windows and input uses CR+LF convention
    Sébastien Villemot authored
    If the input .mod file uses CR+LF convention, and if the user is under Windows,
    then the output of the macroprocessor (as given by the “savemacro” option) had
    incorrect end of lines: those would be CR+CR+LF.
    
    The reason is that some TextNode(s) internally created by the macroprocessor
    would themselves contain CR+LF sequences, which would then be transformed into
    CR+CR+LF in the output (because MinGW transforms LF into CR+LF in output
    streams).
    
    The fix consists in changing the nature of the EOL token: the parsed text is no
    longer attached to it, so that the Bison file now systematically turns it into
    a LF inside TextNode(s).
    
    Closes: #80