mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
corrected lower/upper changes in File
svn-id: r4898
This commit is contained in:
parent
687e82c0fa
commit
bb6bff1b5e
@ -39,22 +39,32 @@ bool File::open(const char *filename, int mode, byte encbyte) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user