refactor readTermcap

This commit is contained in:
Christopher Jeffrey 2013-02-23 16:03:39 -06:00
parent fb752f1783
commit f83e3304d1
1 changed files with 2 additions and 6 deletions

View File

@ -750,12 +750,8 @@ Tput.prototype.readTermcap = function() {
this.termcap = {};
if (process.env.TERMCAP) {
this.termcap.data = process.env.TERMCAP;
} else {
var file = path.resolve('/etc/termcap');
this.termcap.data = fs.readFileSync(file, 'utf8');
}
this.termcap.data = process.env.TERMCAP
|| fs.readFileSync('/etc/termcap', 'ascii');
this.termcap.terms = this.parseTermcap(this.termcap.data);
this.termcap.info = this.termcap.terms[this.term];