wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src game.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src game.cpp
Date: Tue, 28 Jun 2005 12:23:46 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/06/28 16:23:46

Modified files:
        src            : game.cpp 

Log message:
        fixed error messages for user campaigns

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.258&tr2=1.259&r1=text&r2=text

Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.258 wesnoth/src/game.cpp:1.259
--- wesnoth/src/game.cpp:1.258  Tue Jun 28 00:28:16 2005
+++ wesnoth/src/game.cpp        Tue Jun 28 16:23:46 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.258 2005/06/28 00:28:16 Sirp Exp $ */
+/* $Id: game.cpp,v 1.259 2005/06/28 16:23:46 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -1276,6 +1276,11 @@
                                std::vector<std::string> user_campaigns, 
error_campaigns;
                                
get_files_in_dir(user_campaign_dir,&user_campaigns,NULL,ENTIRE_FILE_PATH);
                                for(std::vector<std::string>::const_iterator uc 
= user_campaigns.begin(); uc != user_campaigns.end(); ++uc) {
+                                       static const std::string extension = 
".cfg";
+                                       if(uc->size() < extension.size() || 
std::equal(uc->end() - extension.size(),uc->end(),extension.begin()) == false) {
+                                               continue;
+                                       }
+
                                        try {
                                                scoped_istream stream = 
preprocess_file(*uc,&defines_map);
 
@@ -1287,7 +1292,7 @@
                                                if(campaign_error_log.empty()) {
                                                        
cfg.append(user_campaign_cfg);
                                                } else {
-                                                       user_error_log += 
error_log;
+                                                       user_error_log += 
campaign_error_log;
                                                        
error_campaigns.push_back(*uc);
                                                }
                                        } catch(config::error& err) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]