# HG changeset patch # User arpi # Date 1042288344 0 # Node ID 18427eee920570833cf5ecd39be23277ddce4aeb # Parent 546db4583ad774792184b2b6e53f80417f62d43d The attached little patch fixes a core dump on termcap systems when $TERM is undefined. Frederick Bruckman diff -r 546db4583ad7 -r 18427eee9205 linux/getch2.c --- 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;}