summaryrefslogtreecommitdiffstats
path: root/lib/Utils
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-01-19 14:52:53 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-01-19 14:52:53 +0100
commit8ddcb9404d65bc6b09910099988fe6a0f33fe250 (patch)
tree2214c48219c8f3cf1b4110113467fa92d38bfa84 /lib/Utils
parent04d69684f58d851ab604b2ed5eeb04f373efd4d8 (diff)
parentb348085ac9f3d4a7ded81026bffa962a065bdf97 (diff)
downloadabrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.tar.gz
abrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.tar.xz
abrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.zip
resolve conflict
Diffstat (limited to 'lib/Utils')
-rw-r--r--lib/Utils/make_descr.cpp68
1 files changed, 32 insertions, 36 deletions
diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp
index 90bd76a9..2a0d4a99 100644
--- a/lib/Utils/make_descr.cpp
+++ b/lib/Utils/make_descr.cpp
@@ -50,9 +50,6 @@ static void add_content(bool &was_multiline, string& description, const char *he
}
}
-/* Text attachments smaller than this will be also included in descrition */
-#define INLINE_TEXT_ATT_SIZE (2*1024)
-
string make_description_bz(const map_crash_report_t& pCrashReport)
{
string description;
@@ -79,22 +76,21 @@ string make_description_bz(const map_crash_report_t& pCrashReport)
const string &filename = it->first;
const string &type = it->second[CD_TYPE];
const string &content = it->second[CD_CONTENT];
- if (type == CD_TXT
- || (type == CD_ATT && content.size() < INLINE_TEXT_ATT_SIZE)
- ) {
- if (filename != CD_UUID
- && filename != FILENAME_ARCHITECTURE
- && filename != FILENAME_RELEASE
- && filename != CD_REPRODUCE
- && filename != CD_COMMENT
- ) {
- add_content(was_multiline, description, filename.c_str(), content.c_str());
- }
- continue;
- }
- if (type == CD_ATT)
+ if (type == CD_TXT)
{
- add_content(was_multiline, description, "Attached file", filename.c_str());
+ if (content.size() <= CD_TEXT_ATT_SIZE)
+ {
+ if (filename != CD_UUID
+ && filename != FILENAME_ARCHITECTURE
+ && filename != FILENAME_RELEASE
+ && filename != CD_REPRODUCE
+ && filename != CD_COMMENT
+ ) {
+ add_content(was_multiline, description, filename.c_str(), content.c_str());
+ }
+ } else {
+ add_content(was_multiline, description, "Attached file", filename.c_str());
+ }
}
}
@@ -113,7 +109,6 @@ string make_description_logger(const map_crash_report_t& pCrashReport)
const string &type = it->second[CD_TYPE];
const string &content = it->second[CD_CONTENT];
if (type == CD_TXT
- || type == CD_ATT
|| type == CD_BIN
) {
if (content == "1.\n2.\n3.\n")
@@ -181,26 +176,27 @@ string make_description_catcut(const map_crash_report_t& pCrashReport)
const string &content = it->second[CD_CONTENT];
if (type == CD_TXT)
{
- if (filename != CD_UUID
- && filename != FILENAME_ARCHITECTURE
- && filename != FILENAME_RELEASE
- && filename != CD_REPRODUCE
- && filename != CD_COMMENT
- ) {
- pDescription += '\n';
+ if (content.length() <= CD_TEXT_ATT_SIZE)
+ {
+ if (filename != CD_UUID
+ && filename != FILENAME_ARCHITECTURE
+ && filename != FILENAME_RELEASE
+ && filename != CD_REPRODUCE
+ && filename != CD_COMMENT
+ ) {
+ pDescription += '\n';
+ pDescription += filename;
+ pDescription += "\n-----\n";
+ pDescription += content;
+ pDescription += "\n\n";
+ }
+ } else {
+ pDescription += "\n\nAttached files\n"
+ "----\n";
pDescription += filename;
- pDescription += "\n-----\n";
- pDescription += content;
- pDescription += "\n\n";
+ pDescription += '\n';
}
}
- else if (type == CD_ATT)
- {
- pDescription += "\n\nAttached files\n"
- "----\n";
- pDescription += filename;
- pDescription += '\n';
- }
else if (type == CD_BIN)
{
error_msg(_("Binary file %s will not be reported"), filename.c_str());