From 0485bd935b235e1162332ca145e7fbb6e5aecb3b Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 14 Jan 2010 14:11:27 +0000 Subject: Made EntityList able to handle several files with same macroname and version number, without corrupting the internal data structure (switched from map to multimap). --- server/src/templatelist.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/src/templatelist.cc') diff --git a/server/src/templatelist.cc b/server/src/templatelist.cc index b952467..0fc8ec5 100644 --- a/server/src/templatelist.cc +++ b/server/src/templatelist.cc @@ -44,7 +44,8 @@ void TemplateList::addFile(std::string file) try { parser.parse(); Template *templ = parser.getTemplate(); - (*this)[templ->attributes["name"]][VersionStr(templ->attributes["version"])] = file; + std::pair p(VersionStr(templ->attributes["version"]), file); + (*this)[templ->attributes["name"]].insert(p); } catch(Exception &e) { PRACRO_WARN(templatelist, "Skipping %s: %s\n", file.c_str(), e.what()); } -- cgit v1.2.3