From 73a34e8d2cbf969388711d5ce66a61fbb1916cd4 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 14 Nov 2015 16:36:11 +0100 Subject: [PATCH] fix for checking templates availability --- src/ebusd/main.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index 2b138590..9d18d917 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -532,17 +532,14 @@ static result_t collectConfigFiles(const string path, const string prefix, const if (S_ISDIR(stat_buf.st_mode)) { if (dirs!=NULL) dirs->push_back(p); - } else if (S_ISREG(stat_buf.st_mode)) { - if ((prefix.length()==0 || (name.length()>=prefix.length() && name.substr(0, prefix.length())==prefix)) - && name.length()>=extension.length() - && name.substr(name.length()-extension.length())==extension) { - if (name=="_templates"+extension) { - if (hasTemplates) { - *hasTemplates = true; - } - } else { - files.push_back(p); + } else if (S_ISREG(stat_buf.st_mode) && name.length()>=extension.length() + && name.substr(name.length()-extension.length())==extension) { + if (name=="_templates"+extension) { + if (hasTemplates) { + *hasTemplates = true; } + } else if (prefix.length()==0 || (name.length()>=prefix.length() && name.substr(0, prefix.length())==prefix)) { + files.push_back(p); } } }