[Mplayer-cvslog] CVS: main/libvo font_load.c,1.17,1.18

Arpi of Ize arpi at mplayer.dev.hu
Mon Aug 6 02:22:19 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv18128

Modified Files:
	font_load.c 
Log Message:
DATADIR/font/ patch by Adam Tla/lka atlka at pg.gda.pl

Index: font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- font_load.c	20 Jul 2001 02:03:50 -0000	1.17
+++ font_load.c	6 Aug 2001 00:22:13 -0000	1.18
@@ -2,6 +2,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "config.h"
 #include "font_load.h"
@@ -42,6 +45,7 @@
 unsigned char sor2[1024];
 font_desc_t *desc;
 FILE *f;
+struct stat fstate;
 char section[64];
 int i,j;
 int chardb=0;
@@ -51,10 +55,12 @@
 desc=malloc(sizeof(font_desc_t));if(!desc) return NULL;
 memset(desc,0,sizeof(font_desc_t));
 
-desc->fpath=get_path("font/");
-
 f=fopen(fname,"rt");if(!f){ printf("font: can't open file: %s\n",fname); return NULL;}
 
+desc->fpath=get_path("font/");
+	
+if (stat(desc->fpath, &fstate)!=0) desc->fpath=DATADIR"/font";
+	
 // set up some defaults, and erase table
 desc->charspace=2;
 desc->spacewidth=12;




More information about the MPlayer-cvslog mailing list