summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-10 00:10:22 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-10 00:10:22 +0100
commit9d2cb4518c3a8a72ccc714ddbc131aaa84506092 (patch)
treee21efa47e3ed2e2f911c87fad8d0d992f236124a /lib/utils
parentd1c6a4329284a1daba12a7e0fbd743a90cb0d884 (diff)
downloadabrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.tar.gz
abrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.tar.xz
abrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.zip
Decouple settings handling from old-style plugins
The breakage was discovered when i removed Logger class. it turned out the fix is somewhat involved. This change implements it as discussed with the rest of the team. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/Makefile.am1
-rw-r--r--lib/utils/Plugin.cpp15
-rw-r--r--lib/utils/overlapping_strcpy.c22
3 files changed, 23 insertions, 15 deletions
diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am
index 129feeb5..37508ee7 100644
--- a/lib/utils/Makefile.am
+++ b/lib/utils/Makefile.am
@@ -16,6 +16,7 @@ libABRTUtils_la_SOURCES = \
xfuncs.c \
concat_path_file.c \
append_to_malloced_string.c \
+ overlapping_strcpy.c \
encbase64.c \
stdio_helpers.c \
hash_md5.c hash_md5.h \
diff --git a/lib/utils/Plugin.cpp b/lib/utils/Plugin.cpp
index 8c00e609..bf237959 100644
--- a/lib/utils/Plugin.cpp
+++ b/lib/utils/Plugin.cpp
@@ -40,21 +40,6 @@ void CPlugin::SetSettings(const map_plugin_settings_t& pSettings)
}
}
-const map_plugin_settings_t& CPlugin::GetSettings()
-{
- VERB3
- {
- log("GetSettings:");
- map_plugin_settings_t::const_iterator it = m_pSettings.begin();
- while (it != m_pSettings.end())
- {
- log(" settings[%s]:'%s'", it->first.c_str(), it->second.c_str());
- it++;
- }
- }
- return m_pSettings;
-}
-
bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings,
bool skipKeysWithoutValue /*= true*/)
{
diff --git a/lib/utils/overlapping_strcpy.c b/lib/utils/overlapping_strcpy.c
new file mode 100644
index 00000000..41c1c1a1
--- /dev/null
+++ b/lib/utils/overlapping_strcpy.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ */
+#include "abrtlib.h"
+
+/* Like strcpy but can copy overlapping strings. */
+void overlapping_strcpy(char *dst, const char *src)
+{
+ /* Cheap optimization for dst == src case -
+ * better to have it here than in many callers.
+ */
+ if (dst != src)
+ {
+ while ((*dst = *src) != '\0')
+ {
+ dst++;
+ src++;
+ }
+ }
+}