X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=status.c;h=8f58fec83884dbd5edbf61eb39754ca8434a021e;hp=09a9df81453f46ceedb4c15ce76505ab61693601;hb=c7ceecd31e97891dd5cf48536d4bddf2c1d7d9dd;hpb=f404a0ca916be07049af51a3022baaaaab94def6 diff --git a/status.c b/status.c index 09a9df8..8f58fec 100644 --- a/status.c +++ b/status.c @@ -41,6 +41,7 @@ static char *get_sort_str (char *buf, size_t buflen, int method) } /* %b = number of incoming folders with unread messages [option] + * %B = short mailbox path * %d = number of deleted messages [option] * %f = full mailbox path * %F = number of flagged messages [option] @@ -55,7 +56,7 @@ static char *get_sort_str (char *buf, size_t buflen, int method) * %s = current sorting method ($sort) * %S = current aux sorting method ($sort_aux) * %t = # of tagged messages [option] - * %v = Mutt version + * %v = Mutt-ng version * %V = currently active limit pattern [option] */ static const char * status_format_str (char *buf, size_t buflen, char op, const char *src, @@ -63,7 +64,7 @@ status_format_str (char *buf, size_t buflen, char op, const char *src, const char *elsestring, unsigned long data, format_flag flags) { - char fmt[SHORT_STRING], tmp[SHORT_STRING], *cp; + char fmt[SHORT_STRING], tmp[SHORT_STRING], *cp, *p; int count, optional = (flags & M_FORMAT_OPTIONAL); MUTTMENU *menu = (MUTTMENU *) data; @@ -80,6 +81,30 @@ status_format_str (char *buf, size_t buflen, char op, const char *src, optional = 0; break; + case 'B': + snprintf (fmt, sizeof (fmt), "%%%ss", prefix); +#ifdef USE_COMPRESSED + if (Context && Context->compressinfo && Context->realpath) + { + if ((p = strrchr (Context->realpath, '/'))) + strfcpy (tmp, p + 1, sizeof (tmp)); + else + strfcpy (tmp, Context->realpath, sizeof (tmp)); + } + else +#endif + if (Context && Context->path) + { + if ((p = strrchr (Context->path, '/'))) + strfcpy (tmp, p + 1, sizeof (tmp)); + else + strfcpy (tmp, Context->path, sizeof (tmp)); + } + else + strfcpy (tmp, _("no mailbox"), sizeof (tmp)); + snprintf (buf, buflen, fmt, tmp); + break; + case 'd': if (!optional) { @@ -270,7 +295,7 @@ status_format_str (char *buf, size_t buflen, char op, const char *src, break; case 'v': - snprintf (fmt, sizeof (fmt), "Mutt %%s"); + snprintf (fmt, sizeof (fmt), "Mutt-ng %%s"); snprintf (buf, buflen, fmt, MUTT_VERSION); break;