[MPlayer-dev-eng] [PATCH] Fix core dump on termcap systems when $TERM undefined

Frederick Bruckman fredb at immanent.net
Sat Jan 11 12:33:07 CET 2003


Hi,

The attached little patch fixes a core dump on termcap systems when
$TERM is undefined.

Frederick
-------------- next part --------------
Index: linux/getch2.c
===================================================================
RCS file: /cvsroot/mplayer/main/linux/getch2.c,v
retrieving revision 1.15
diff -u -r1.15 getch2.c
--- linux/getch2.c	1 Nov 2002 00:05:56 -0000	1.15
+++ linux/getch2.c	11 Jan 2003 10:54:36 -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;}


More information about the MPlayer-dev-eng mailing list