From 110059704d0e816e99d74698ebe83a18f045fd35 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 9 Mar 2013 04:57:39 -0600 Subject: [PATCH] fix else...then. --- lib/tput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {');