fix else...then.

This commit is contained in:
Christopher Jeffrey 2013-03-09 04:57:39 -06:00
parent 9ee2cbb5ed
commit 110059704d

View File

@ -882,7 +882,9 @@ Tput.prototype._compile = function(val) {
end = val.indexOf('%;');
// Terminfo does elseif's like
// this: %?[expr]%t...%e[expr]%t...%;
if (then < end && then < els) {
// if (then < end && then < els) {
// if (then !== -1 && then < end && then < els) {
if (then !== -1 && then < end && (els !== -1 && then < els)) {
stmt('} else if (');
} else {
stmt('} else {');