From fe0e82f046ab1c8fb36ac0ab3396c79b762a85b3 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 23 Feb 2013 15:58:59 -0600 Subject: [PATCH] add references to termcap data for all term names. --- lib/tput.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; }