Module: sems Branch: master Commit: b881668a6081f1a7c23ac9306ec4b11b9bc01819 URL: https://github.com/sems-server/sems/commit/b881668a6081f1a7c23ac9306ec4b11b9bc01819
Author: Juha Heinanen <[email protected]> Committer: Juha Heinanen <[email protected]> Date: 2015-10-06T10:34:49+03:00 apps/dsm: when including a directory, include only files that end with ".dsm" --- Modified: apps/dsm/DSMStateDiagramCollection.cpp --- Diff: https://github.com/sems-server/sems/commit/b881668a6081f1a7c23ac9306ec4b11b9bc01819.diff Patch: https://github.com/sems-server/sems/commit/b881668a6081f1a7c23ac9306ec4b11b9bc01819.patch --- diff --git a/apps/dsm/DSMStateDiagramCollection.cpp b/apps/dsm/DSMStateDiagramCollection.cpp index 170edbc..0110d1d 100644 --- a/apps/dsm/DSMStateDiagramCollection.cpp +++ b/apps/dsm/DSMStateDiagramCollection.cpp @@ -88,10 +88,10 @@ bool DSMStateDiagramCollection::readFile(const string& filename, const string& n dp = opendir(include_name.c_str()); if (dp != NULL) { while ((ep = readdir(dp))) { - if (strncmp(ep->d_name, ".", 1) == 0) continue; - include_dir_name = include_name + "/" + std::string(ep->d_name); - if (!readFile(include_dir_name, std::string(ep->d_name), - current_load_path, s)) { + string name(ep->d_name); + if (name.rfind(".dsm") != (name.size() - 4)) continue; + include_dir_name = include_name + "/" + name; + if (!readFile(include_dir_name, name, current_load_path, s)) { (void)closedir(dp); return false; } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
