mail[Wesnoth-commits] r27177 - /trunk/src/filesystem.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on June 14, 2008 - 20:54:
Author: alink
Date: Sat Jun 14 20:54:34 2008
New Revision: 27177

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27177&view=rev
Log:
Try "type-less" binary locations (not in /images, /sounds...) after standard
ones (with type, which is almost always what we use)

Modified:
    trunk/src/filesystem.cpp

Modified: trunk/src/filesystem.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.cpp?rev=27177&r1=27176&r2=27177&view=diff
==============================================================================
--- trunk/src/filesystem.cpp (original)
+++ trunk/src/filesystem.cpp Sat Jun 14 20:54:34 2008
@@ -860,15 +860,9 @@
 
 std::string get_binary_file_location(const std::string& type, const 
std::string& filename)
 {
+       DBG_FS << "Looking for " << filename << "\n";
+
        const std::vector<std::string>& paths = get_binary_paths(type);
-       if(!filename.empty()) {
-               DBG_FS << "Looking for " << filename << " in  '.'\n";
-               if(file_exists(filename)) {
-                 DBG_FS << "  Found at " << filename << "\n";
-                       return filename;
-               }
-       }
-
        for(std::vector<std::string>::const_iterator i = paths.begin(); i != 
paths.end(); ++i) {
                const std::string file = *i + filename;
                DBG_FS << "  Checking " << *i << "\n";
@@ -878,6 +872,14 @@
                }
        }
 
+       if(!filename.empty()) {
+               DBG_FS << "  Checking '.' \n";
+               if(file_exists(filename)) {
+                 DBG_FS << "  Found at " << filename << "\n";
+                       return filename;
+               }
+       }
+
        DBG_FS << "  " << filename << " not found.\n";
        return "";
 }




Related Messages


Powered by MHonArc, Updated Sat Jun 14 21:02:13 2008