fixed warnings (and simplified the code, gosh, aquadran, why so complicated? :-)

svn-id: r5264
This commit is contained in:
Max Horn 2002-10-22 23:36:54 +00:00
parent 64195315e2
commit 6e5ff6884f

View File

@ -29,7 +29,6 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char
strcpy(buf, directory);
if (directory[0] != 0) {
strcpy(buf, directory);
#ifdef __MORPHOS__
if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
#endif
@ -41,25 +40,25 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char
if (file)
return file;
struct t_dirs {
char dir[20];
} dirs[] = {
const char *dirs[] = {
"",
"video/", "VIDEO/",
"data/", "DATA/",
"resource/", "RESOURCE/"
"video/",
"VIDEO/",
"data/",
"DATA/",
"resource/",
"RESOURCE/"
};
for (uint8 l = 0; l < 7; l++) {
strcpy(buf, directory);
if (directory[0] != 0) {
strcpy(buf, directory);
#ifdef __MORPHOS__
if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
#endif
strcat(buf, "/");
}
strcat(buf, dirs[l].dir);
strcat(buf, dirs[l]);
int8 len = strlen(buf);
strcat(buf, filename);