diff --git a/lib/tput.js b/lib/tput.js index 395cca0..8e6fb57 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -984,7 +984,9 @@ Tput.prototype._compile = function(info, key, str) { if (read(/^%([+\-*\/m&|\^=><])/)) { if (ch === '=') ch = '==='; else if (ch === 'm') ch = '%'; - expr('(stack.push(v = (stack.pop() ' + ch + ' stack.pop()) || 0), v)'); + expr('(v = stack.pop(),' + + ' stack.push(v = (stack.pop() ' + ch + ' v) || 0),' + + ' v)'); continue; }