diff --git a/lib/tput.js b/lib/tput.js index c2ffd11..fd21bb5 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -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 {');