mail[Wesnoth-commits] r33264 - in /trunk: changelog src/gamestatus.cpp src/gamestatus.hpp


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

Header


Content

Posted by koraq on March 01, 2009 - 20:02:
Author: mordante
Date: Sun Mar  1 20:02:54 2009
New Revision: 33264

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33264&view=rev
Log:
Fix savegame cache corruption.

This bug is caused by the .gz suffix, some parts of the engine used it
with and some parts without. Now always make sure the suffix is there.
There still might be glitches if the old save_index.gz isn't cleared.
Fixes bug #12815 and Debian bug #483782.

Modified:
    trunk/changelog
    trunk/src/gamestatus.cpp
    trunk/src/gamestatus.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33264&r1=33263&r2=33264&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar  1 20:02:54 2009
@@ -40,6 +40,7 @@
    * Align all network buffers on 4 bytes
    * Partial fix for bug #13092: avoid a case of invalid iterator usage
      in FormulaAI
+   * Fix savegame cache corruption (bug #12815/Debian bug #483782)
 
 Version 1.5.11:
  * Campaigns:

Modified: trunk/src/gamestatus.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=33264&r1=33263&r2=33264&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Sun Mar  1 20:02:54 2009
@@ -956,8 +956,17 @@
        return save_index_cfg;
 }
 
-config& save_summary(const std::string& save)
-{
+config& save_summary(std::string save)
+{
+       /* 
+        * All saves are .gz files now so make sure we use that name when 
opening
+        * a file. If not some parts of the code use the name with and some 
parts
+        * without the .gz suffix.
+        */
+       if(save.length() >= 3 && save.substr(save.length() - 3) != ".gz") {
+               save += ".gz";
+       }
+
        config& cfg = save_index();
        config* res = cfg.find_child("save","save",save);
        if(res == NULL) {

Modified: trunk/src/gamestatus.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.hpp?rev=33264&r1=33263&r2=33264&view=diff
==============================================================================
--- trunk/src/gamestatus.hpp (original)
+++ trunk/src/gamestatus.hpp Sun Mar  1 20:02:54 2009
@@ -337,7 +337,7 @@
 /** Delete a savegame. */
 void delete_game(const std::string& name);
 
-config& save_summary(const std::string& save);
+config& save_summary(std::string save);
 
 void write_save_index();
 




Related Messages


Powered by MHonArc, Updated Sun Mar 01 21:20:06 2009