From 12be46a5f66c34129cae2819c634e9a98e31113c Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Tue, 20 Dec 2016 21:55:35 -0700 Subject: * Bug fix: The index format would be chopped at the position of an unrecognized token, instead of skipping the token as intended. --- pith/mailindx.c | 14 ++++++++++---- pith/pine.hlp | 5 ++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pith/mailindx.c b/pith/mailindx.c index f6a2ba5b..efa6854d 100644 --- a/pith/mailindx.c +++ b/pith/mailindx.c @@ -655,17 +655,20 @@ parse_index_format(char *format_str, INDEX_COL_S **answer) /* ignore unrecognized word */ if(!pt){ + char c; for(q = p; *p && !isspace((unsigned char)*p); p++) ; - if(*p) - *p++ = '\0'; + if((c = *p) != '\0') + *p++ = '\0'; dprint((1, "parse_index_format: unrecognized token: %s\n", q ? q : "?")); q_status_message1(SM_ORDER | SM_DING, 0, 3, _("Unrecognized word in index-format: %s"), q); + if(c != '\0') + *(p-1) = c; continue; } @@ -4990,8 +4993,11 @@ date_str(char *datesrc, IndexColType type, int v, char *str, size_t str_len, ? month_abbrev_locale(d.month) : "???", sizeof(monabb)); monabb[sizeof(monabb)-1] = '\0'; - if(d.day >= 1 && d.day <= 31) - snprintf(dayzero, sizeof(dayzero), "%02d", d.day); + if(d.day >= 1 && d.day <= 31){ + snprintf(dayzero, sizeof(dayzero), "%*d", 2, d.day); +// if(d.day < 10) +// dayzero[0] = ' '; + } else{ strncpy(dayzero, "??", sizeof(dayzero)); dayzero[sizeof(dayzero)-1] = '\0'; diff --git a/pith/pine.hlp b/pith/pine.hlp index 22269013..e6b66081 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 196 2016-12-18 22:45:44 +Alpine Commit 197 2016-12-20 21:55:31 ============= h_news ================= @@ -441,6 +441,9 @@ Bugs that have been addressed include: messages other than top of threads could appear in the index, making Alpine display messages "out of the screen." +
  • The index format would be chopped at the position of an unrecognized + token, instead of skipping the token as intended. +
  • Work in progress: Avoid calling non-safe functions when Alpine receives a signal. See bug report here. -- cgit v1.2.3-70-g09d2