--- a/fix-date-fill.diff Wed May 15 13:32:42 2013 +0300
+++ b/fix-date-fill.diff Wed Nov 12 23:04:36 2014 +0200
@@ -1,32 +1,34 @@
# HG changeset patch
-# Parent 450e74018eb436aef07e67ef7ae49cd05f48b3c9
+# Parent 634cc23e8c1c5764623d17d12170b3fb7d67e5d9
Fix empty prefix filling
Not useful in vanilla, as there's no prefixes
longer than that static string. Also not add spaces
to prefixes - they are already in format string.
-diff -r 450e74018eb4 mcabber/mcabber/screen.c
---- a/mcabber/mcabber/screen.c Thu Oct 18 01:49:44 2012 +0300
-+++ b/mcabber/mcabber/screen.c Thu Oct 18 02:08:24 2012 +0300
-@@ -1139,9 +1139,9 @@
+XXX: Not really sure about this all, why are we getting rid of spaces in the end?
+
+diff -r 634cc23e8c1c mcabber/mcabber/screen.c
+--- a/mcabber/mcabber/screen.c Fri Oct 17 22:42:07 2014 +0200
++++ b/mcabber/mcabber/screen.c Tue Nov 11 20:58:44 2014 +0200
+@@ -1087,9 +1087,9 @@
if (line->timestamp &&
!(line->flags & (HBB_PREFIX_SPECIAL|HBB_PREFIX_CONT))) {
-- strftime(date, 30, gettprefix(), localtime(&line->timestamp));
-+ strftime(date, 63, gettprefix(), localtime(&line->timestamp));
+- timepreflen = strftime(date, 30, gettprefix(), localtime(&line->timestamp));
++ timepreflen = strftime(date, 63, gettprefix(), localtime(&line->timestamp));
} else
- strcpy(date, " ");
+ memset(date, ' ', (preflen>64) ? 64 : preflen);
if (!(line->flags & HBB_PREFIX_CONT)) {
if (line->flags & HBB_PREFIX_INFO) {
-@@ -1181,13 +1181,12 @@
+@@ -1129,13 +1129,12 @@
receiptflag = '-';
g_snprintf(pref, preflen, "%s%c%c> ", date, receiptflag, cryptflag);
} else if (line->flags & HBB_PREFIX_SPECIAL) {
-- strftime(date, 30, getspectprefix(), localtime(&line->timestamp));
+- timepreflen = strftime(date, 30, getspectprefix(), localtime(&line->timestamp));
- g_snprintf(pref, preflen, "%s ", date);
-+ strftime(pref, preflen, getspectprefix(), localtime(&line->timestamp));
++ timepreflen = strftime(pref, preflen, getspectprefix(), localtime(&line->timestamp));
} else {
- g_snprintf(pref, preflen, "%s ", date);
+ strncpy(pref, date, preflen);
@@ -35,5 +37,5 @@
- g_snprintf(pref, preflen, " ");
+ strncpy(pref, date, preflen);
}
+ return timepreflen;
}
-