aboutsummaryrefslogtreecommitdiff
path: root/common/file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/file.cpp')
-rw-r--r--common/file.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/common/file.cpp b/common/file.cpp
index 665466beea..7fa6ec39f7 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -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);