Make wesnoth work properly again if the datadir contains '../'.

This is needed if you start wesnoth from the src directory with

$ wesnoth ../

This broke the tutorial for me, since the gender macro is stored
in a separate file.
This commit is contained in:
Mark de Wever 2008-01-15 21:13:11 +00:00
parent bf41b45f01
commit f56dfd22d4
2 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,7 @@ Version 1.3.14+svn:
* Special notes should be more readable now (patch #941)
* Fixed :control command to work
* Fixed boost test compile with 1.34.1
* make wesnoth work properly again if the datadir contains ../
Version 1.3.14:
* campaigns:

View File

@ -823,8 +823,8 @@ bool preprocessor_data::get_chunk()
}
// Ignore filenames that start with '../' or contain '/../'.
if (nfname.rfind("../", 0) == std::string::npos
&& nfname.find("/../") == std::string::npos)
if (newfilename.rfind("../", 0) == std::string::npos
&& newfilename.find("/../") == std::string::npos)
{
if (!slowpath_)
new preprocessor_file(target_, nfname);
@ -839,7 +839,7 @@ bool preprocessor_data::get_chunk()
strings_.back() += res.str();
}
} else {
ERR_CF << "Illegal path '" << nfname
ERR_CF << "Illegal path '" << newfilename
<< "' found (../ not allowed).\n";
}
} else {