Index: file.c
===================================================================
--- file.c	(revision 311)
+++ file.c	(revision 312)
@@ -55,54 +55,12 @@
 FILE *fp;
 int i;
 char found=0;
-char *complete_path;
-char path[] = ".:media:..:../media";
-char *test;
-char *context;
 
 if(!file || !strlen(file))
     return NULL;
 
-//explicit absolute path
-if (file[0] == '/')
-  complete_path = file;
-//explicit relative path
-else if (file[0] == '.')
-{
-   complete_path = malloc(sizeof(char) * (strlen(getcwd(NULL, 0)) + strlen(file) + 2));
-   strcpy(complete_path, getcwd(NULL, 0));
-   strcat(complete_path, "/");
-   strcat(complete_path, file);
-}
-
-//no path given :
-else 
-{
-  test = strtok_r(path, ":", &context);
-  while (test) 
-    {
-      complete_path = malloc(sizeof(char) * (strlen(file) + strlen(test) + 2));
-      strcpy(complete_path, test);
-      strcat(complete_path, "/");
-      strcat(complete_path, file);
-      if (access(complete_path, R_OK) == 0)
-	{
-	  break;
-	} 
-      else
-	{
-	  free(complete_path);
-          complete_path=NULL;
-	}
-      test = strtok_r(NULL, ":", &context);
-    }
-}
- 
-if (!complete_path || strlen(complete_path) == 0)
-     complete_path=file;
-     
 for(i=0;i<raydium_file_log_fopen_index;i++)
-    if(!strcmp(raydium_file_log_fopen[i],complete_path))
+    if(!strcmp(raydium_file_log_fopen[i],file))
 	{
 	found=1;
 	break;
@@ -112,22 +70,19 @@
 
 if(strchr(mode,'w') || raydium_init_cli_option("repository-disable",NULL))
     {
-    return fopen(complete_path,mode);
+    return fopen(file,mode);
     }
 
 if( !raydium_init_cli_option("repository-refresh",NULL) && 
     !raydium_init_cli_option("repository-force",NULL) )
 {
- fp=fopen(complete_path,mode);
+ fp=fopen(file,mode);
  if(fp) return fp;
 }
+raydium_rayphp_repository_file_get(file);
+fp=fopen(file,mode);
 
-//if (access("font2.tga", R_OK) == 0)
-//    raydium_osd_printf(2,98,16,0.5,"font2.tga","Loading %s", file);
-raydium_rayphp_repository_file_get(complete_path);
-// caution, complete_path is now garbage, 
-// let's use file because we dl in "." directory anyways
-return fopen(file,mode);
+return fp;
 #else
 return fopen(file,mode);
 #endif