if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_deleted : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_deleted : 0);
}
- else if (!Context || (Context->mailbox->msg_deleted == 0))
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_deleted == 0))
optional = 0;
break;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_flagged : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_flagged : 0);
}
- else if (!Context || (Context->mailbox->msg_flagged == 0))
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_flagged == 0))
optional = 0;
break;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%ss", prec);
- mutt_str_pretty_size(tmp, sizeof(tmp), Context ? Context->mailbox->size : 0);
+ mutt_str_pretty_size(tmp, sizeof(tmp),
+ (Context && Context->mailbox) ? Context->mailbox->size : 0);
snprintf(buf, buflen, fmt, tmp);
}
- else if (!Context || !Context->mailbox->size)
+ else if (!Context || !Context->mailbox || !Context->mailbox->size)
optional = 0;
break;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_count : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_count : 0);
}
- else if (!Context || (Context->mailbox->msg_count == 0))
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_count == 0))
optional = 0;
break;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->vcount : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->vcount : 0);
}
else if (!Context || !Context->pattern)
optional = 0;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_new : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_new : 0);
}
- else if (!Context || (Context->mailbox->msg_new == 0))
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_new == 0))
optional = 0;
break;
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt,
- Context ? (Context->mailbox->msg_unread - Context->mailbox->msg_new) : 0);
+ (Context && Context->mailbox) ?
+ (Context->mailbox->msg_unread - Context->mailbox->msg_new) :
+ 0);
}
- else if (!Context || ((Context->mailbox->msg_unread - Context->mailbox->msg_new) == 0))
+ else if (!Context || !Context->mailbox ||
+ ((Context->mailbox->msg_unread - Context->mailbox->msg_new) == 0))
optional = 0;
break;
{
size_t i = 0;
- if (Context)
+ if (Context && Context->mailbox)
{
i = OptAttachMsg ?
3 :
case 'R':
{
- int read = Context ? (Context->mailbox->msg_count - Context->mailbox->msg_unread) : 0;
+ int read = (Context && Context->mailbox) ?
+ (Context->mailbox->msg_count - Context->mailbox->msg_unread) :
+ 0;
if (!optional)
{
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_tagged : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_tagged : 0);
}
else if (!Context || !Context->mailbox || (Context->mailbox->msg_tagged == 0))
optional = 0;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_unread : 0);
+ snprintf(buf, buflen, fmt,
+ (Context && Context->mailbox) ? Context->mailbox->msg_unread : 0);
}
- else if (!Context || (Context->mailbox->msg_unread == 0))
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_unread == 0))
optional = 0;
break;