From 61bf615168d1619f97d00ed7b08ea4a92c916732 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 5 Aug 2004 11:10:27 +0000 Subject: Try the current dir last, not first svn-id: r14469 --- common/file.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common/file.cpp') diff --git a/common/file.cpp b/common/file.cpp index adf0eca1af..6b7b954942 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -142,12 +142,13 @@ bool File::open(const char *filename, AccessMode mode, const char *directory) { _handle = fopenNoCase(filename, directory, modeStr); } else { Common::StringList::const_iterator x; - // First try the current directory - _handle = fopenNoCase(filename, "", modeStr); - // Next try all default directories + // Try all default directories for (x = _defaultDirectories.begin(); _handle == NULL && x != _defaultDirectories.end(); ++x) { _handle = fopenNoCase(filename, x->c_str(), modeStr); } + // Last resort: try the current directory + if (_handle == NULL) + _handle = fopenNoCase(filename, "", modeStr); } if (_handle == NULL) { -- cgit v1.2.3