summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-06-28 11:45:30 +0200
committerKarel Klic <kklic@redhat.com>2010-06-28 11:45:30 +0200
commit15e077272bdcdb61300c16c70818a8364a2e0e7c (patch)
treecbc02ad2dc8a680fcb866c60a84e5d0ffe407cf8
parentb4f665e1569983b9274b236c2bfbec83d8bc0664 (diff)
parente2c4e442285eafe1269825515c2c4a4ab1a1776a (diff)
downloadabrt-15e077272bdcdb61300c16c70818a8364a2e0e7c.tar.gz
abrt-15e077272bdcdb61300c16c70818a8364a2e0e7c.tar.xz
abrt-15e077272bdcdb61300c16c70818a8364a2e0e7c.zip
Merge branch 'clicommentfix'
-rw-r--r--src/CLI/report.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp
index e3ecb0e3..ebaeafa1 100644
--- a/src/CLI/report.cpp
+++ b/src/CLI/report.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 RedHat inc.
+ Copyright (C) 2009, 2010 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -302,6 +302,19 @@ static int read_crash_report(map_crash_data_t &report, const char *text)
}
/**
+ * Ensures that the fields needed for editor are present in the crash data.
+ * Fields: comments, how to reproduce.
+ */
+static void create_fields_for_editor(map_crash_data_t &crash_data)
+{
+ if (crash_data.find(FILENAME_COMMENT) == crash_data.end())
+ add_to_crash_data_ext(crash_data, FILENAME_COMMENT, CD_TXT, CD_ISEDITABLE, "");
+
+ if (crash_data.find(FILENAME_REPRODUCE) == crash_data.end())
+ add_to_crash_data_ext(crash_data, FILENAME_REPRODUCE, CD_TXT, CD_ISEDITABLE, "1. \n2. \n3. \n");
+}
+
+/**
* Runs external editor.
* Returns:
* 0 if the launch was successful
@@ -663,6 +676,7 @@ int report(const char *crash_id, int flags)
/* Open text editor and give a chance to review the backtrace etc. */
if (!(flags & CLI_REPORT_BATCH))
{
+ create_fields_for_editor(cr);
int result = run_report_editor(cr);
if (result != 0)
return result;