fix incorrect highlighting when input file starts with line break

Sun, 11 Jun 2023 15:21:44 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 11 Jun 2023 15:21:44 +0200
changeset 71
d5af9261231d
parent 70
60cecca5e484
child 72
b533da8e7411

fix incorrect highlighting when input file starts with line break

src/c2html.c file | annotate | diff | comparison | revisions
--- a/src/c2html.c	Sun Jun 11 15:16:48 2023 +0200
+++ b/src/c2html.c	Sun Jun 11 15:21:44 2023 +0200
@@ -107,7 +107,7 @@
     /* create the line pointer array */
     CxList *lines = cxArrayListCreateSimple(CX_STORE_POINTERS, est_cap);
     cxListAdd(lines, inputbuffer);
-    for (size_t i = 1; i < inputbuflen; i++) {
+    for (size_t i = 0; i < inputbuflen; i++) {
         if (inputbuffer[i] == '\n' && i + 1 < inputbuflen) {
             cxListAdd(lines, inputbuffer + i + 1);
         }

mercurial