From aac74a7785bdc0ed63fa1bd502877d2786874637 Mon Sep 17 00:00:00 2001 From: arpi Date: Sat, 11 Jan 2003 12:32:24 +0000 Subject: [PATCH] The attached little patch fixes a core dump on termcap systems when $TERM is undefined. Frederick Bruckman git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8890 b3059339-0415-0410-9bf9-f77b7e298cf2 --- linux/getch2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/getch2.c b/linux/getch2.c index ec5e9ab1d8..dec9b91a0f 100644 --- a/linux/getch2.c +++ b/linux/getch2.c @@ -79,6 +79,7 @@ static int success=0; 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;}