[BACK]Return to term.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libterminfo

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libterminfo/term.c between version 1.7 and 1.8

version 1.7, 2010/02/11 13:11:47 version 1.8, 2010/02/11 14:36:09
Line 44  __RCSID("$NetBSD$");
Line 44  __RCSID("$NetBSD$");
 #include <term_private.h>  #include <term_private.h>
 #include <term.h>  #include <term.h>
   
 #define TERMINFO_DIRS           "/usr/share/misc/terminfo"  #define _PATH_TERMINFO          "/usr/share/misc/terminfo"
   
 static char database[PATH_MAX];  static char database[PATH_MAX];
 static char pathbuf[PATH_MAX];  static char pathbuf[PATH_MAX];
Line 291  _ti_dbgettermp(TERMINAL *term, const cha
Line 291  _ti_dbgettermp(TERMINAL *term, const cha
         return e;          return e;
 }  }
   
 int  static int
 _ti_getterm(TERMINAL *term, const char *name, int flags)  _ti_findterm(TERMINAL *term, const char *name, int flags)
 {  {
         int r;          int r;
         char *e, h[PATH_MAX];          char *e, h[PATH_MAX];
         size_t i;  
         const struct compiled_term *t;  
   
         _DIAGASSERT(term != NULL);          _DIAGASSERT(term != NULL);
         _DIAGASSERT(name != NULL);          _DIAGASSERT(name != NULL);
Line 305  _ti_getterm(TERMINAL *term, const char *
Line 303  _ti_getterm(TERMINAL *term, const char *
         database[0] = '\0';          database[0] = '\0';
         _ti_database = NULL;          _ti_database = NULL;
   
         e = getenv("TERMINFO");          if ((e = getenv("TERMINFO")) != NULL) {
         if (e != NULL)                  if (e[0] == '/')
                 return _ti_dbgetterm(term, e, name, flags);                          return _ti_dbgetterm(term, e, name, flags);
           }
   
         e = getenv("HOME");          if ((e = getenv("TERMINFO_DIRS")) != NULL)
         if (e != NULL) {                  return _ti_dbgettermp(term, e, name, flags);
   
           r = 0;
           if ((e = getenv("HOME")) != NULL) {
                 snprintf(h, sizeof(h), "%s/.terminfo", e);                  snprintf(h, sizeof(h), "%s/.terminfo", e);
                 r = _ti_dbgetterm(term, h, name, flags);                  r = _ti_dbgetterm(term, h, name, flags);
                 if (r == 1)  
                         return 1;  
         }          }
           if (r != 1)
                   r = _ti_dbgettermp(term, _PATH_TERMINFO, name, flags);
   
         r = _ti_dbgettermp(term, TERMINFO_DIRS, name, flags);          return r;
   
   }
   
   int
   _ti_getterm(TERMINAL *term, const char *name, int flags)
   {
           int r;
           size_t i;
           const struct compiled_term *t;
   
           r = _ti_findterm(term, name, flags);
         if (r == 1)          if (r == 1)
                 return 1;                  return 1;
   
Line 331  _ti_getterm(TERMINAL *term, const char *
Line 344  _ti_getterm(TERMINAL *term, const char *
   
         return r;          return r;
 }  }
   
 void  void
 _ti_freeterm(TERMINAL *term)  _ti_freeterm(TERMINAL *term)
 {  {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

CVSweb <webmaster@jp.NetBSD.org>