swf_LoadFont() now returns more quickly if the file doesn't exist.
authorkramm <kramm>
Thu, 5 Feb 2004 13:41:50 +0000 (13:41 +0000)
committerkramm <kramm>
Thu, 5 Feb 2004 13:41:50 +0000 (13:41 +0000)
lib/modules/swffont.c

index f8f7707..21a19e6 100644 (file)
@@ -414,7 +414,7 @@ static int isSWF(const char*filename)
     char a[8];
     if(!fi) {
        perror(filename);
-       return 0;
+       return -1;
     }
     memset(a, 0, sizeof(a));
     fread(a, 4, 1, fi);
@@ -428,7 +428,10 @@ static int isSWF(const char*filename)
 
 SWFFONT* swf_LoadFont(char*filename)
 {
-    if(isSWF(filename)) {
+    int is_swf = isSWF(filename);
+    if(is_swf<0)
+       return 0;
+    if(is_swf) {
        return swf_ReadFont(filename);
     }
 #if defined(HAVE_FREETYPE)