X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fstatus.c;h=3da31d9b0ea359a7f024557abd6c9b4cafe424f4;hp=1f756a5f0f61f3dae2e821a00c027042da356d6e;hb=1eeaaac6bdcad962c41bf975a32078cc4a0e578c;hpb=96e4b6de291b2195b26289fb03536acd101c6650 diff --git a/lib-ui/status.c b/lib-ui/status.c index 1f756a5..3da31d9 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -7,28 +7,16 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include +#include #include #include +#include #include "mutt.h" #include "sort.h" -#include "mx.h" #include "buffy.h" - -#include -#include -#include - #define SW (option(OPTMBOXPANE)?SidebarWidth:0) static char *get_sort_str (char *buf, ssize_t buflen, int method) @@ -64,7 +52,7 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, const char *elsestring, unsigned long data, format_flag flags) { - char fmt[SHORT_STRING], tmp[SHORT_STRING]; + char fmt[STRING], tmp[STRING]; const char *cp, *p; int count, optional = (flags & M_FORMAT_OPTIONAL); MUTTMENU *menu = (MUTTMENU *) data; @@ -82,7 +70,7 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, case 'B': snprintf (fmt, sizeof (fmt), "%%%ss", prefix); - if (Context && Context->compressinfo && Context->realpath) { + if (Context && Context->cinfo && Context->realpath) { if ((p = strrchr (Context->realpath, '/'))) m_strcpy(tmp, sizeof(tmp), p + 1); else @@ -116,17 +104,16 @@ static const char *status_format_str (char *buf, ssize_t buflen, char op, case 'f': snprintf (fmt, sizeof (fmt), "%%%ss", prefix); - if (Context && Context->compressinfo && Context->realpath) { + if (Context && Context->cinfo && Context->realpath) { m_strcpy(tmp, sizeof(tmp), Context->realpath); mutt_pretty_mailbox (tmp); - } - else + } else if (Context && Context->path) { m_strcpy(tmp, sizeof(tmp), Context->path); mutt_pretty_mailbox (tmp); - } - else + } else { m_strcpy(tmp, sizeof(tmp), _("(no mailbox)")); + } snprintf (buf, buflen, fmt, tmp); break; @@ -306,7 +293,7 @@ void menu_status_line (char* buf, ssize_t len, MUTTMENU* menu, const char* p) { * only to not wrap past end of screen */ int width = COLS - SW; - mutt_FormatString (buf, (width >= len ? len : (width + 1)), + m_strformat (buf, (width >= len ? len : (width + 1)), p, status_format_str, (unsigned long) menu, 0); }