]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/toe.c
ncurses 5.9 - patch 20131027
[ncurses.git] / progs / toe.c
index f60d84e853c027981272ea2ea15a58ae05049a13..d57a5fe49f48c1391357ff4248235bdc97d1fc15 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -44,7 +44,7 @@
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: toe.c,v 1.70 2012/11/17 23:39:42 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.72 2013/05/25 20:13:07 tom Exp $")
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
@@ -259,8 +259,11 @@ term_description(TERMTYPE *tp)
 {
     const char *desc;
 
-    if ((desc = strrchr(tp->term_names, '|')) == 0 || *++desc == '\0')
+    if (tp->term_names == 0
+       || (desc = strrchr(tp->term_names, '|')) == 0
+       || (*++desc == '\0')) {
        desc = "(No description)";
+    }
 
     return desc;
 }
@@ -320,7 +323,7 @@ sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
     data->description = strmalloc(term_description(tp));
 }
 
-#if USE_TERMCAP
+#if NCURSES_USE_TERMCAP
 static void
 show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
 {
@@ -347,7 +350,7 @@ show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
 }
 #endif
 
-#if USE_DATABASE
+#if NCURSES_USE_DATABASE
 static char *
 copy_entryname(DIRENT * src)
 {
@@ -371,7 +374,7 @@ typelist(int eargc, char *eargv[],
     int i;
 
     for (i = 0; i < eargc; i++) {
-#if USE_DATABASE
+#if NCURSES_USE_DATABASE
        if (_nc_is_dir_path(eargv[i])) {
            char *cwd_buf = 0;
            DIR *termdir;
@@ -499,7 +502,7 @@ typelist(int eargc, char *eargv[],
        }
 #endif
 #endif
-#if USE_TERMCAP
+#if NCURSES_USE_TERMCAP
 #if HAVE_BSD_CGETENT
        {
            CGETENT_CONST char *db_array[2];