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.23 2007/04/06 14:49:12 grubba Exp $ + // $Id: Terminfo.pmod,v 1.24 2007/04/30 12:55:10 grubba Exp $   #pike __REAL_VERSION__         #if constant(thread_create)   #define LOCK object m_key = mutex->lock()   #define UNLOCK destruct(m_key)   #define MUTEX static private object(Thread.Mutex) mutex = Thread.Mutex();   #else   #define LOCK   #define UNLOCK
pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:424:    string tce = [string]getenv("TERMCAP");    if (tce && sizeof(tce) && tce[0]=='/')    filename = tce;    else if ((getenv("OSTYPE") == "msys") &&    (filename = getenv("SHELL"))) {    // MinGW    // Usually something like "C:/msys/1.0/bin/sh"    // Termcap is in "C:/msys/1.0/etc/termcap"    filename = combine_path(filename, "../../etc/termcap");    } -  else -  filename = "/etc/termcap"; +  else { +  filename = "/etc/termcap"; // Default. +  foreach(({ "/etc/termcap", "/usr/share/termcap", +  "/usr/share/misc/termcap", }), string fname) { +  .Stat s = file_stat(fname); +  if (s && s->type == "file") { +  filename = fname; +  break;    } -  +  } +  } +  }    if (!::open(filename, "r")) {    error("failed to open termcap file %O\n", filename);    }    }       static private void rewind(int|void pos)    {    ::seek(pos);    buf="";    }