fixes plaintext output

Tue, 23 Aug 2016 13:59:48 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 23 Aug 2016 13:59:48 +0200
changeset 40
903b46fc4214
parent 39
ac35daceb24c
child 41
c06ab07fd29d

fixes plaintext output

src/c2html.c file | annotate | diff | comparison | revisions
--- a/src/c2html.c	Tue Aug 23 13:49:38 2016 +0200
+++ b/src/c2html.c	Tue Aug 23 13:59:48 2016 +0200
@@ -99,10 +99,11 @@
         } else {
             char *c = sourceline->data;
             size_t dp = 0;
-            while (*c) {
+            while (*c && *c != '\n') {
                 dp = writeescapedchar(line->space, dp, *c);
                 c++;
             }
+            line->space[dp++] = '\n';
             line->space[dp] = '\0';
         }
 

mercurial