changeset 8889:18427eee9205

The attached little patch fixes a core dump on termcap systems when $TERM is undefined. Frederick Bruckman <fredb@immanent.net>
author arpi
date Sat, 11 Jan 2003 12:32:24 +0000
parents 546db4583ad7
children c9cbfb9d720c
files linux/getch2.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/linux/getch2.c	Sat Jan 11 10:35:31 2003 +0000
+++ b/linux/getch2.c	Sat Jan 11 12:32:24 2003 +0000
@@ -79,6 +79,7 @@
 
 int load_termcap(char *termtype){
   if(!termtype) termtype=getenv("TERM");
+  if(!termtype) termtype="unknown";
   success=tgetent(term_buffer, termtype);
   if(success<0){ printf("Could not access the 'termcap' data base.\n"); return 0; }
   if(success==0){ printf("Terminal type `%s' is not defined.\n", termtype);return 0;}