fix-date-fill.diff
changeset 92 66f7e2aa040c
parent 87 78238d26911a
equal deleted inserted replaced
91:51d326d5cb92 92:66f7e2aa040c
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent 634cc23e8c1c5764623d17d12170b3fb7d67e5d9
     2 # Parent 634cc23e8c1c5764623d17d12170b3fb7d67e5d9
       
     3 # Parent  d1357df25a61fc92b64302ae645cce5b14b452f2
     3 Fix empty prefix filling
     4 Fix empty prefix filling
     4 Not useful in vanilla, as there's no prefixes
     5 Not useful in vanilla, as there's no prefixes
     5 longer than that static string. Also not add spaces
     6 longer than that static string. Also not add spaces
     6 to prefixes - they are already in format string.
     7 to prefixes - they are already in format string.
     7 
     8 
     8 XXX: Not really sure about this all, why are we getting rid of spaces in the end?
     9 XXX: Not really sure about this all, why are we getting rid of spaces in the end?
     9 
    10 
    10 diff -r 634cc23e8c1c mcabber/mcabber/screen.c
    11 diff -r d1357df25a61 mcabber/mcabber/screen.c
    11 --- a/mcabber/mcabber/screen.c	Fri Oct 17 22:42:07 2014 +0200
    12 --- a/mcabber/mcabber/screen.c	Fri Dec 09 01:38:42 2016 +0200
    12 +++ b/mcabber/mcabber/screen.c	Tue Nov 11 20:58:44 2014 +0200
    13 +++ b/mcabber/mcabber/screen.c	Fri Dec 09 01:48:22 2016 +0200
    13 @@ -1087,9 +1087,9 @@
    14 @@ -1115,9 +1115,9 @@
    14  
    15  
    15    if (line->timestamp &&
    16    if (line->timestamp &&
    16        !(line->flags & (HBB_PREFIX_SPECIAL|HBB_PREFIX_CONT))) {
    17        !(line->flags & (HBB_PREFIX_SPECIAL|HBB_PREFIX_CONT))) {
    17 -    timepreflen = strftime(date, 30, gettprefix(), localtime(&line->timestamp));
    18 -    timepreflen = strftime(date, 30, gettprefix(), localtime(&line->timestamp));
    18 +    timepreflen = strftime(date, 63, gettprefix(), localtime(&line->timestamp));
    19 +    timepreflen = strftime(date, 63, gettprefix(), localtime(&line->timestamp));
    20 -    strcpy(date, "           ");
    21 -    strcpy(date, "           ");
    21 +    memset(date, ' ', (preflen>64) ? 64 : preflen);
    22 +    memset(date, ' ', (preflen>64) ? 64 : preflen);
    22  
    23  
    23    if (!(line->flags & HBB_PREFIX_CONT)) {
    24    if (!(line->flags & HBB_PREFIX_CONT)) {
    24      if (line->flags & HBB_PREFIX_INFO) {
    25      if (line->flags & HBB_PREFIX_INFO) {
    25 @@ -1129,13 +1129,12 @@
    26 @@ -1157,13 +1157,12 @@
    26          receiptflag = '-';
    27          receiptflag = '-';
    27        g_snprintf(pref, preflen, "%s%c%c> ", date, receiptflag, cryptflag);
    28        g_snprintf(pref, preflen, "%s%c%c> ", date, receiptflag, cryptflag);
    28      } else if (line->flags & HBB_PREFIX_SPECIAL) {
    29      } else if (line->flags & HBB_PREFIX_SPECIAL) {
    29 -      timepreflen = strftime(date, 30, getspectprefix(), localtime(&line->timestamp));
    30 -      timepreflen = strftime(date, 30, getspectprefix(), localtime(&line->timestamp));
    30 -      g_snprintf(pref, preflen, "%s   ", date);
    31 -      g_snprintf(pref, preflen, "%s   ", date);