diff --git a/lib/tput.js b/lib/tput.js index 1e98c45..ae1d128 100644 --- a/lib/tput.js +++ b/lib/tput.js @@ -47,6 +47,7 @@ function Tput(options) { this.compileTerminfo(); } } catch (e) { + // if (e.message === 'Terminal not found.') { this.term = 'vt102'; this.compileTermcap(); } @@ -178,7 +179,9 @@ Tput.prototype.parseTerminfo = function(data) { while (data[j]) j++; - if (s >= data.length || j > data.length) { + // assert.ok(j < data.length); + if (j >= data.length) { + // throw new Error('Error parsing terminfo.'); delete info.strings[key]; return; } @@ -278,7 +281,6 @@ Tput.prototype.parseExtended = function(data) { // Booleans Section // One byte for each flag - // Same order as var _bools = []; l = i + h.boolCount; for (; i < l; i++) { @@ -331,7 +333,9 @@ Tput.prototype.parseExtended = function(data) { while (data[j]) j++; - if (s >= data.length || j > data.length) { + // assert.ok(j < data.length); + if (j >= data.length) { + // throw new Error('Error parsing terminfo.'); _strings[k] = ''; return; }