From 6e5ff6884fb422ce0a9dca3a5347ca114c3f0cd9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 22 Oct 2002 23:36:54 +0000 Subject: fixed warnings (and simplified the code, gosh, aquadran, why so complicated? :-) svn-id: r5264 --- common/file.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'common') 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); -- cgit v1.2.3