Compare commits

..

1 Commits

Author SHA1 Message Date
Automatic Release Builder
0702f85540 new version: 2017.1.0 2016-11-17 13:43:29 +01:00
4 changed files with 3 additions and 28 deletions

View File

@@ -612,14 +612,6 @@ private:
SG_LOG(SG_TERRASYNC, SG_WARN, "malformed .dirindex file: invalid type in line '" << line << "', expected 'd' or 'f', (ignoring line)" );
continue;
}
// security: prevent writing outside the repository via ../../.. filenames
// (valid filenames never contain / - subdirectories have their own .dirindex)
if ((tokens[1] == "..") || (tokens[1].find_first_of("/\\") != std::string::npos)) {
SG_LOG(SG_TERRASYNC, SG_WARN, "malformed .dirindex file: invalid filename in line '" << line << "', (ignoring line)" );
continue;
}
children.push_back(ChildInfo(typeData == "f" ? ChildInfo::FileType : ChildInfo::DirectoryType, tokens[1], tokens[2]));
if (tokens.size() > 3) {

View File

@@ -175,14 +175,9 @@ int parseTest()
// expected
}
unsigned int skisVariantFull = p2->indexOfVariant("org.flightgear.test.catalog1.c172p-skis");
VERIFY(skisVariantFull > 0);
unsigned int skisVariant = p2->indexOfVariant("c172p-skis");
VERIFY(skisVariant > 0);
COMPARE(skisVariant, skisVariantFull);
pkg::Package::ThumbnailVec thumbs2 = p2->thumbnailsForVariant(skisVariant);
COMPARE(thumbs2.size(), 2);

View File

@@ -340,25 +340,13 @@ std::string Package::nameForVariant(const std::string& vid) const
unsigned int Package::indexOfVariant(const std::string& vid) const
{
// accept fully-qualified IDs here
std::string actualId = vid;
size_t lastDot = vid.rfind('.');
if (lastDot != std::string::npos) {
std::string catalogId = vid.substr(0, lastDot);
if (catalogId != catalog()->id()) {
throw sg_exception("Bad fully-qualified ID:" + vid + ", package mismatch" );
}
actualId = vid.substr(lastDot + 1);
}
if (actualId == id()) {
if (vid == id()) {
return 0;
}
unsigned int result = 1;
for (SGPropertyNode* var : m_props->getChildren("variant")) {
if (var->getStringValue("id") == actualId) {
if (var->getStringValue("id") == vid) {
return result;
}

View File

@@ -1 +1 @@
2016.4.4
2017.1.0