---
 src/log/logd/lgs_filehdl.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/log/logd/lgs_filehdl.cc b/src/log/logd/lgs_filehdl.cc
index 0d7fb2b74..238259454 100644
--- a/src/log/logd/lgs_filehdl.cc
+++ b/src/log/logd/lgs_filehdl.cc
@@ -965,8 +965,10 @@ static int chr_cnt_b(char *str, char c, int lim) {
 static std::string file_name_find_g;
 static int filter_logfile_name(const struct dirent *finfo) {
   int found = 0;
+  int len = file_name_find_g.length();
 
-  if ((strstr(finfo->d_name, file_name_find_g.c_str()) != nullptr) &&
+  if ((strncmp(finfo->d_name, file_name_find_g.c_str(), len) == 0) &&
+      isdigit(finfo->d_name[len + 1]) &&
       (strstr(finfo->d_name, ".log") != nullptr))
     found = 1;
 
-- 
2.17.1



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to