Author: alink
Date: Thu May 24 23:38:51 2007
New Revision: 17837

URL: http://svn.gna.org/viewcvs/wesnoth?rev=17837&view=rev
Log:
Kill the last "//" before _main.cfg on linux.
Copy the same ugly block of code for generate path(/)file.cfg used with 
standard files (since it seems to works 
fine)
And paste it for generate the path(/)_main.cfg (since it seems bogus on win/mac)
This double use must probably be in a function. Maybe later (or never if we use 
boost?)

Modified:
    trunk/src/filesystem.cpp

Modified: trunk/src/filesystem.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.cpp?rev=17837&r1=17836&r2=17837&view=diff
==============================================================================
--- trunk/src/filesystem.cpp (original)
+++ trunk/src/filesystem.cpp Thu May 24 23:38:51 2007
@@ -407,8 +407,17 @@
 
        if (reorder == DO_REORDER) {
                LOG_FS << "searching _main.cfg in directory " << directory << 
'\n';
-               const char *maincfg = (directory + "/" + MAINCFG).c_str(); 
-               if (stat(maincfg, &st) == 0) {
+               std::string maincfg;
+               if (directory.empty() || directory[directory.size()-1] == '/'
+#ifdef __AMIGAOS4__
+                       || (directory[directory.size()-1]==':')
+#endif /* __AMIGAOS4__ */
+               )
+                       maincfg = directory + MAINCFG;
+               else
+                       maincfg = (directory + "/") + MAINCFG;
+
+               if (stat(maincfg.c_str(), &st) == 0) {
                        LOG_FS << "_main.cfg found : " << maincfg << '\n';
                        if (files != NULL) {
                                if (mode == ENTIRE_FILE_PATH)


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to