pike.git / lib / modules / Stdio.pmod / Terminfo.pmod

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:1: - // $Id: Terminfo.pmod,v 1.1 1999/03/13 01:12:37 marcus Exp $ + // $Id: Terminfo.pmod,v 1.2 1999/03/17 23:17:42 marcus Exp $         #if constant(thread_create)   #define LOCK object m_key = mutex->lock()   #define UNLOCK destruct(m_key)   #define MUTEX static private object mutex = Thread.Mutex();   #else   #define LOCK   #define UNLOCK   #define MUTEX
pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:327:    static private int load_cap(object f)    {    int magic, sname, nbool, nnum, nstr, sstr;       if (6!=sscanf(swab(f->read(12)), "%2c%2c%2c%2c%2c%2c",    magic, sname, nbool, nnum, nstr, sstr) ||    magic != 0432)    return 0;    aliases = (f->read(sname)-"\0")/"|";    { -  array(int) bools = values(f->read(nbool+(nbool&1))[..nbool-1]); +  array(int) bools = values(f->read(nbool/*+(nbool&1)*/)/*[..nbool-1]*/);    if (sizeof(bools)>sizeof(boolnames))    bools = bools[..sizeof(boolnames)-1];    map = mkmapping(boolnames[..sizeof(bools)-1], bools);    }    {    array(int) nums = array_sscanf(swab(f->read(nnum*2)), "%2c"*nnum);    if (sizeof(nums)>sizeof(numnames))    nums = nums[..sizeof(numnames)-1];    mapping(string:int) tmp = mkmapping(numnames[..sizeof(nums)-1], nums);    foreach (numnames[..sizeof(nums)-1], string name)
pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:745:    string tc = getenv("TERMCAP");    t = (tc && sizeof(tc) && tc[0]!='/'?    Termcap(tc) : getTerm(getenv("TERM")||"dumb"));    LOCK;    if (!defterm)    defterm = t;    UNLOCK;    }    return t;    } -  return getTerminfo(term) || getTermcap(term); +  return getTerminfo(term) || getTermcap(term) || getFallbackTerm(term);   } -  +  + static object getFallbackTerm(string term) + { +  return (term=="dumb"? Termcap("dumb:\\\n\t:am:co#80:do=^J:") : +  getTerm("dumb")); + }