From 0b8b5d1f3b5f45374d1e43390777b2de51fb7728 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 4 May 2008 21:47:36 +0000 Subject: (svn r12943) -Fix: reading/modifying invalid data under some circumstances. --- src/fileio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.cpp b/src/fileio.cpp index 09329b84f..c6eb90ca9 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -315,7 +315,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd f = fopen(buf, mode); #if !defined(WIN32) if (f == NULL) { - strtolower(buf + strlen(_searchpaths[sp]) - 1); + strtolower(buf + ((subdir == NO_DIRECTORY) ? 0 : strlen(_searchpaths[sp]) - 1)); f = fopen(buf, mode); } #endif -- cgit v1.2.3-54-g00ecf