summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Plugins/CCpp.cpp32
-rw-r--r--src/Daemon/PluginManager.cpp7
2 files changed, 34 insertions, 5 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index dadff976..612d40c3 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -575,7 +575,37 @@ string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir)
string unstrip_n_output = run_unstrip_n(pDebugDumpDir);
string independentBuildIdPC;
GetIndependentBuildIdPC(unstrip_n_output.c_str(), independentBuildIdPC);
- return CreateHash((package + executable + independentBuildIdPC).c_str());
+
+ /* package variable has "firefox-3.5.6-1.fc11[.1]" format */
+ /* Remove distro suffix and maybe least significant version number */
+ char *trimmed_package = xstrdup(package.c_str());
+ char *p = trimmed_package;
+ while (*p)
+ {
+ if (*p == '.' && (p[1] < '0' || p[1] > '9'))
+ {
+ /* We found "XXXX.nondigitXXXX", trim this part */
+ *p = '\0';
+ break;
+ }
+ p++;
+ }
+ char *first_dot = strchr(trimmed_package, '.');
+ if (first_dot)
+ {
+ char *last_dot = strrchr(first_dot, '.');
+ if (last_dot != first_dot)
+ {
+ /* There are more than one dot: "1.2.3"
+ * Strip last part, we don't want to distinquish crashes
+ * in packages which differ only by minor release number.
+ */
+ *last_dot = '\0';
+ }
+ }
+ string hash_str = trimmed_package + executable + independentBuildIdPC;
+ free(trimmed_package);
+ return CreateHash(hash_str.c_str());
}
string CAnalyzerCCpp::GetGlobalUUID(const char *pDebugDumpDir)
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp
index c552880c..273ccebf 100644
--- a/src/Daemon/PluginManager.cpp
+++ b/src/Daemon/PluginManager.cpp
@@ -159,16 +159,15 @@ void CPluginManager::UnLoadPlugins()
CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only)
{
- map_string_t plugin_info;
-
- plugin_info["Name"] = pName;
-
map_plugin_t::iterator it_plugin = m_mapPlugins.find(pName);
if (it_plugin != m_mapPlugins.end())
{
return it_plugin->second; /* ok */
}
+ map_string_t plugin_info;
+ plugin_info["Name"] = pName;
+
const char *conf_name = pName;
if (strncmp(pName, "Kerneloops", sizeof("Kerneloops")-1) == 0)
{