summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorFrank Celler <[email protected]>2012-04-22 07:40:31 +0200
committerFrank Celler <[email protected]>2012-04-22 07:40:31 +0200
commit9760b7f126cfd5bb8ab8764331ad876b8e23297c (patch)
tree6562d6203760d2b2fa2ec4b3a0ff6fc96bf85eb0 /src
parentfc125524b2ece07fc70e782cc1a232d794dd4f6d (diff)
downloadmruby-9760b7f126cfd5bb8ab8764331ad876b8e23297c.tar.gz
mruby-9760b7f126cfd5bb8ab8764331ad876b8e23297c.zip
simple fix for underflow
Diffstat (limited to 'src')
-rw-r--r--src/parse.y9
1 files changed, 5 insertions, 4 deletions
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;
}