fileio.c
changeset 561 9a0c469a251c
parent 193 0a7025304867
child 810 a1494b19bd2a
equal deleted inserted replaced
560:60e198893a41 561:9a0c469a251c
   108 		char *s;
   108 		char *s;
   109 		// Make lower case and try again
   109 		// Make lower case and try again
   110 		for(s=buf + strlen(_path.data_dir) - 1; *s != 0; s++)
   110 		for(s=buf + strlen(_path.data_dir) - 1; *s != 0; s++)
   111 			*s = tolower(*s);
   111 			*s = tolower(*s);
   112 		f = fopen(buf, "rb");
   112 		f = fopen(buf, "rb");
       
   113 		
       
   114 #if defined SECOND_DATA_DIR
       
   115 	// tries in the 2nd data directory
       
   116 		if (f == NULL) {
       
   117 			sprintf(buf, "%s%s", _path.second_data_dir, filename);
       
   118 			for(s=buf + strlen(_path.second_data_dir) - 1; *s != 0; s++)
       
   119 			*s = tolower(*s);
       
   120 		f = fopen(buf, "rb");
       
   121 		}
       
   122 #endif
   113 	}
   123 	}
   114 #endif
   124 #endif
   115 
   125 
   116 	if (f == NULL)
   126 	if (f == NULL)
   117 		error("Cannot open file '%s'", buf);
   127 		error("Cannot open file '%s'", buf);