---
src/cli/cli.c | 33 +++++++++++++++++++++------------
1 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/cli/cli.c b/src/cli/cli.c
index f9c8b4b..c0f90a1 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -86,6 +86,10 @@ static void print_crash(crash_data_t *crash_data)
/* Create a localized string from crash time. */
const char *timestr = get_crash_item_content_or_die(crash_data, FILENAME_TIME);
char *timeloc = localize_crash_time(timestr);
+ const char *uid = get_crash_item_content_or_NULL(crash_data, FILENAME_UID);
+ const char *package = get_crash_item_content_or_NULL(crash_data, FILENAME_PACKAGE);
+ const char *executable = get_crash_item_content_or_NULL(crash_data,
FILENAME_EXECUTABLE);
+ const char *count = get_crash_item_content_or_NULL(crash_data, FILENAME_COUNT);
printf(_("\tCrash dump : %s\n"
"\tUID : %s\n"
@@ -94,11 +98,9 @@ static void print_crash(crash_data_t *crash_data)
"\tCrash Time : %s\n"
"\tCrash Count: %s\n"),
get_crash_item_content_or_NULL(crash_data, CD_DUMPDIR),
- get_crash_item_content_or_NULL(crash_data, FILENAME_UID),
- get_crash_item_content_or_NULL(crash_data, FILENAME_PACKAGE),
- get_crash_item_content_or_NULL(crash_data, FILENAME_EXECUTABLE),
+ uid ? uid : "", package ? package : "", executable ?
executable : "",
timeloc,
- get_crash_item_content_or_NULL(crash_data, FILENAME_COUNT)
+ count ? count : ""
);
free(timeloc);
@@ -139,6 +141,14 @@ static void print_crash_info(crash_data_t *crash_data, bool
show_backtrace)
{
const char *timestr = get_crash_item_content_or_die(crash_data, FILENAME_TIME);
char *timeloc = localize_crash_time(timestr);
+ const char *analyzer = get_crash_item_content_or_NULL(crash_data,
FILENAME_ANALYZER);
+ const char *component = get_crash_item_content_or_NULL(crash_data,
FILENAME_COMPONENT);
+ const char *package = get_crash_item_content_or_NULL(crash_data, FILENAME_PACKAGE);
+ const char *cmdline = get_crash_item_content_or_NULL(crash_data, FILENAME_CMDLINE);
+ const char *executable = get_crash_item_content_or_NULL(crash_data,
FILENAME_EXECUTABLE);
+ const char *os_release = get_crash_item_content_or_NULL(crash_data,
FILENAME_OS_RELEASE);
+ const char *kernel = get_crash_item_content_or_NULL(crash_data, FILENAME_KERNEL);
+ const char *reason = get_crash_item_content_or_NULL(crash_data, FILENAME_REASON);
printf(_("Dump directory: %s\n"
"Last crash: %s\n"
@@ -151,14 +161,13 @@ static void print_crash_info(crash_data_t *crash_data, bool
show_backtrace)
"Reason: %s\n"),
get_crash_item_content_or_die(crash_data, CD_DUMPDIR),
timeloc,
- get_crash_item_content_or_die(crash_data, FILENAME_ANALYZER),
- get_crash_item_content_or_die(crash_data, FILENAME_COMPONENT),
- get_crash_item_content_or_die(crash_data, FILENAME_PACKAGE),
- get_crash_item_content_or_die(crash_data, FILENAME_CMDLINE),
- get_crash_item_content_or_die(crash_data, FILENAME_EXECUTABLE),
- get_crash_item_content_or_die(crash_data, FILENAME_OS_RELEASE),
- get_crash_item_content_or_die(crash_data, FILENAME_KERNEL),
- get_crash_item_content_or_die(crash_data, FILENAME_REASON)
+ analyzer ? analyzer : "",
+ component ? component : "",
+ package ? package : "",
+ cmdline ? cmdline : "",
+ executable ? executable : "",
+ os_release ? os_release : "", kernel ? kernel : "",
+ reason ? reason : ""
);
free(timeloc);
--
1.7.4