shithub: mc

Download patch

ref: bd42672589a4f4ee4a4f059f2f53703f028c48a1
parent: cd97ca1d0d636c4c4b4bb3ff9e687e858551a889
author: Ori Bernstein <[email protected]>
date: Mon Sep 15 22:53:37 EDT 2014

Track line number correctly in tokenizer

    When we had a '\' escaping a newline, this would skip counting
    the escaped newline.

--- a/parse/tok.c
+++ b/parse/tok.c
@@ -140,7 +140,11 @@
         } else if (c == '\\') {
             ignorenl = 1;
             next();
-        } else if (isspace(c) || (ignorenl && c == '\n')) {
+        } else if (ignorenl && c == '\n') {
+            next();
+            line++;
+            ignorenl = 0;
+        } else if (isspace(c)) {
             next();
         } else if (c == '/' && peekn(1) == '*') {
             eatcomment();