fix for checking templates availability

This commit is contained in:
john30
2015-11-14 16:36:11 +01:00
parent 1885ab9eda
commit 73a34e8d2c
+7 -10
View File
@@ -532,17 +532,14 @@ static result_t collectConfigFiles(const string path, const string prefix, const
if (S_ISDIR(stat_buf.st_mode)) { if (S_ISDIR(stat_buf.st_mode)) {
if (dirs!=NULL) if (dirs!=NULL)
dirs->push_back(p); dirs->push_back(p);
} else if (S_ISREG(stat_buf.st_mode)) { } else if (S_ISREG(stat_buf.st_mode) && name.length()>=extension.length()
if ((prefix.length()==0 || (name.length()>=prefix.length() && name.substr(0, prefix.length())==prefix)) && name.substr(name.length()-extension.length())==extension) {
&& name.length()>=extension.length() if (name=="_templates"+extension) {
&& name.substr(name.length()-extension.length())==extension) { if (hasTemplates) {
if (name=="_templates"+extension) { *hasTemplates = true;
if (hasTemplates) {
*hasTemplates = true;
}
} else {
files.push_back(p);
} }
} else if (prefix.length()==0 || (name.length()>=prefix.length() && name.substr(0, prefix.length())==prefix)) {
files.push_back(p);
} }
} }
} }