Don't allow !addincludedir with trailing path separator to propagate to !include

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6526 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-07-18 16:37:08 +00:00
parent d66c9a492f
commit ad03365921
3 changed files with 30 additions and 17 deletions

View file

@ -718,6 +718,20 @@ tstring remove_file_extension(const tstring& path) {
return get_string_prefix(path, _T("."));
}
tstring& path_append_separator(tstring& path)
{
tstring::iterator ib = path.begin(), ie = path.end();
if (ib != ie && !IsPathSeparator(*--ie))
path.push_back(PLATFORM_PATH_SEPARATOR_C);
return path;
}
tstring& path_append(tstring& base, const TCHAR* more)
{
if (IsPathSeparator(*more)) ++more;
return path_append_separator(base) += more;
}
static int PathGetDosDriveNumber(const TCHAR *p)
{
// Note: Unlike PathGetDriveNumber(), we require a path separator after the colon.