Module: sems Branch: master Commit: f480d65e0319662d735b84ffc4768868694c8ec6 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f480d65e0319662d735b84ffc4768868694c8ec6
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Wed Sep 8 18:51:08 2010 +0200 DSM: fix #include path for recursive #include if in absolute path, script path will be the path of the included script --- apps/dsm/DSMStateDiagramCollection.cpp | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/dsm/DSMStateDiagramCollection.cpp b/apps/dsm/DSMStateDiagramCollection.cpp index 07f991d..cc75806 100644 --- a/apps/dsm/DSMStateDiagramCollection.cpp +++ b/apps/dsm/DSMStateDiagramCollection.cpp @@ -66,8 +66,17 @@ bool DSMStateDiagramCollection::readFile(const string& filename, const string& n return false; } - string include_name = r[0]=='/' ? r : load_path+"/"+r; - if (!readFile(include_name, name, load_path, s)) + string current_load_path; + string include_name; + if (r[0]=='/') { + include_name = r; + size_t ppos = r.rfind("/"); + current_load_path = r.substr(0, ppos) + "/"; + } else { + current_load_path = load_path; + include_name = load_path+"/"+r; + } + if (!readFile(include_name, name, current_load_path, s)) return false; continue; } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
