openjdk-23: use OpenJDK 23 as the boot JDK
[oi-userland.git] / components / library / ConsoleKit / patches / 10-ck-history.patch
blob3a8f4c20459d699e44fb7471017ab223886bd383
1 diff --git a/tools/ck-history.c b/tools/ck-history.c
2 index 606106c..e7659d1 100644
3 --- a/tools/ck-history.c
4 +++ b/tools/ck-history.c
5 @@ -60,6 +60,8 @@ typedef enum {
6 #define DEFAULT_LOG_FILENAME LOCALSTATEDIR "/log/ConsoleKit/history"
7 #define MAX_LINE_LEN 2048
9 +#define IS_STR_SET(x) (x != NULL && x[0] != '\0')
11 static GList *all_events = NULL;
13 static gboolean
14 @@ -515,21 +517,21 @@ print_last_report_record (GList *list,
16 if (legacy_compat) {
17 g_string_printf (str,
18 - "%-8.8s %-12.12s %-16.16s %-16.16s",
19 - username,
20 - utline != NULL ? utline : "",
21 - host != NULL ? host : "",
22 - addedtime);
23 + "%s\t%s\t%s\t%s",
24 + IS_STR_SET (username) ? username : "NULL",
25 + IS_STR_SET (utline) ? utline : "NULL",
26 + IS_STR_SET (host) ? host : "NULL",
27 + IS_STR_SET (addedtime) ? addedtime : "NULL");
28 } else {
29 g_string_printf (str,
30 - "%-8.8s %12s %-10.10s %-7.7s %-12.12s %-28.28s %-16.16s",
31 - username,
32 - session_type,
33 - session_id,
34 - seat_id,
35 - utline,
36 - host != NULL ? host : "",
37 - addedtime);
38 + "%s\t%s\t%s\t%s\t%s\t%s\t%s",
39 + IS_STR_SET (username) ? username : "NULL",
40 + IS_STR_SET (session_type) ? session_type : "NULL",
41 + IS_STR_SET (session_id) ? session_id : "NULL",
42 + IS_STR_SET (seat_id) ? seat_id : "NULL",
43 + IS_STR_SET (utline) ? utline : "NULL",
44 + IS_STR_SET (host) ? host : "NULL",
45 + IS_STR_SET (addedtime) ? addedtime : "NULL");
48 g_free (username);
49 @@ -576,9 +578,9 @@ print_last_report_record (GList *list,
52 g_string_append_printf (str,
53 - " %-7.7s %-12.12s",
54 - removedtime,
55 - duration);
56 + "\t%s\t%s",
57 + IS_STR_SET (removedtime) ? removedtime : "NULL",
58 + IS_STR_SET (duration) ? duration : "NULL");
60 g_print ("%s\n", str->str);
61 g_string_free (str, TRUE);