diff --git a/lib/tput.js b/lib/tput.js index 0e6d32f..951d99a 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -791,7 +791,8 @@ Tput.prototype.parseTermcap = function(data) { , field , names , i - , j; + , j + , k; // remove escaped newlines data = data.replace(/\\\n[ \t]*/g, ''); @@ -810,14 +811,19 @@ Tput.prototype.parseTermcap = function(data) { if (j === 0) { names = field.split('|'); - term = terms[names[0]] = { + term = { name: names[0], names: names, desc: names.pop() }; + + k = names.length; + while (k--) terms[names[k]] = term; + term.bools = {}; term.numbers = {}; term.strings = {}; + continue; }