summaryrefslogtreecommitdiffstats
path: root/linux/getch2.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-11 12:32:24 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-11 12:32:24 +0000
commitaac74a7785bdc0ed63fa1bd502877d2786874637 (patch)
tree53b99b67631c6c2d11b2675127c32790f131f895 /linux/getch2.c
parent26908d998b91c13baf78a27cb1af67b8fe05e79b (diff)
downloadmpv-aac74a7785bdc0ed63fa1bd502877d2786874637.tar.bz2
mpv-aac74a7785bdc0ed63fa1bd502877d2786874637.tar.xz
The attached little patch fixes a core dump on termcap systems when
$TERM is undefined. Frederick Bruckman <fredb@immanent.net> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8890 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux/getch2.c')
-rw-r--r--linux/getch2.c1
1 files changed, 1 insertions, 0 deletions
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;}