[Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.5,1.6
Pawe? Ko?odziejski
aquadran at users.sourceforge.net
Mon Sep 2 14:01:17 CEST 2002
Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv7267
Modified Files:
file.cpp
Log Message:
corrected lower/upper changes in File
Index: file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- file.cpp 2 Sep 2002 20:15:14 -0000 1.5
+++ file.cpp 2 Sep 2002 20:53:12 -0000 1.6
@@ -39,22 +39,32 @@
}
clearReadFailed();
+
+ int32 i = 0, pos = 0;
+
strcpy(buf, filename);
+ while (buf[i] != 0) {
+ if ((buf[i] == '/') || (buf[i] == '\\')) {
+ pos = i + 1;
+ }
+ i++;
+ }
+
if (mode == 1) {
_handle = fopen(buf, "rb");
if (_handle == NULL) {
- ptr = buf;
+ ptr = buf + pos;
do
*ptr++ = toupper(*ptr);
while (*ptr);
- _handle = fopen(buf, "rb");
+ _handle = fopen(buf + pos, "rb");
}
if (_handle == NULL) {
- ptr = buf;
+ ptr = buf + pos;
do
*ptr++ = tolower(*ptr);
while (*ptr);
- _handle = fopen(buf, "rb");
+ _handle = fopen(buf + pos, "rb");
}
if (_handle == NULL) {
debug(2, "File %s not found", filename);
More information about the Scummvm-git-logs
mailing list