[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp |
Date: |
Sat, 07 May 2005 15:01:17 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 05/05/07 19:01:17
Modified files:
src/serialization: preprocessor.cpp
Log message:
Fix TRoW loading bug: a comment should leave a trailing newline in the
preprocessed stream.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/preprocessor.cpp.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: wesnoth/src/serialization/preprocessor.cpp
diff -u wesnoth/src/serialization/preprocessor.cpp:1.12
wesnoth/src/serialization/preprocessor.cpp:1.13
--- wesnoth/src/serialization/preprocessor.cpp:1.12 Sat May 7 16:11:22 2005
+++ wesnoth/src/serialization/preprocessor.cpp Sat May 7 19:01:16 2005
@@ -1,4 +1,4 @@
-/* $Id: preprocessor.cpp,v 1.12 2005/05/07 16:11:22 silene Exp $ */
+/* $Id: preprocessor.cpp,v 1.13 2005/05/07 19:01:16 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
@@ -397,11 +397,11 @@
strings_.push_back(std::string());
} else if (c == '#' && !target_.quoted_) {
std::string command = read_word();
+ bool comment = false;
if (command == "define") {
skip_spaces();
int linenum = linenum_;
std::string s = read_line();
- put('\n');
std::vector< std::string > items = utils::split(s, ' ');
if (items.empty()) {
std::ostringstream error;
@@ -494,8 +494,11 @@
<< linenum_ << ' ' << target_.location_;
ERR_CF << error.str() << '\n';
throw config::error(error.str());
- }
+ } else
+ comment = true;
skip_eol();
+ if (comment)
+ put('\n');
} else if (token.type == '{' || token.type == '[') {
if (c == '(') {
if (token.type == '[')
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp,
Guillaume Melquiond <=
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp, Guillaume Melquiond, 2005/05/14
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp, Guillaume Melquiond, 2005/05/14
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp, Guillaume Melquiond, 2005/05/14
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp, ott, 2005/05/14
- [Wesnoth-cvs-commits] wesnoth/src/serialization preprocessor.cpp, Guillaume Melquiond, 2005/05/21