mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 14:49:07 +00:00
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:
parent
bf41b45f01
commit
f56dfd22d4
@ -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:
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user