From 9760b7f126cfd5bb8ab8764331ad876b8e23297c Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Sun, 22 Apr 2012 07:40:31 +0200 Subject: simple fix for underflow --- src/parse.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/parse.y') diff --git a/src/parse.y b/src/parse.y index 9ffe6d33d..62433a6bf 100644 --- a/src/parse.y +++ b/src/parse.y @@ -2976,16 +2976,17 @@ nextc(parser_state *p) c = *p->s++; } if (c == '\n') { - if (p->nerr < 1) { + if (p->column < 0) { + p->column++; // pushback caused an underflow + } + else { p->lineno++; p->column = 0; } // must understand heredoc } else { - if (p->nerr < 1) { - p->column++; - } + p->column++; } return c; } -- cgit v1.2.3