aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-06-12 15:42:42 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-06-12 15:42:42 +0200
commit2ff14d930ec8bee0c2c0190c1dd6f5584236342d (patch)
treef0c5436c359ad318475cade0dc00896cf7f0e62c
parent78c840d4666622cf86c99db0abdcd4a7fb3ffc13 (diff)
downloadfengari-2ff14d930ec8bee0c2c0190c1dd6f5584236342d.tar.gz
fengari-2ff14d930ec8bee0c2c0190c1dd6f5584236342d.tar.bz2
fengari-2ff14d930ec8bee0c2c0190c1dd6f5584236342d.zip
lstrlib.js: matchbalance fixed wrong char lookup
-rw-r--r--src/lstrlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js
index 4b83ac1..ccb0c16 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -934,7 +934,7 @@ const matchbalance = function(ms, s, p) {
if (ms.src[s] === e) {
if (--cont === 0) return s + 1;
}
- else if (s === b) cont++;
+ else if (ms.src[s] === b) cont++;
}
}
return null; /* string ends out of balance */