*p = '_';
}
+/* counts how many characters in s can be skipped while none of the
+ * characters of c appears */
+int mutt_skipchars (const char* s, const char* c) {
+ int ret = 0;
+ const char* p = s;
+ while (s && *s) {
+ register const char* t = c;
+ while (t && *t) {
+ if (*t == *s)
+ return (ret);
+ t++;
+ }
+ ret++;
+ s++;
+ }
+ return (mutt_strlen (p));
+}
void mutt_FormatString (char *dest, /* output buffer */
size_t destlen, /* output buffer len */
ch = *src++; /* pad char */
/* calculate space left on line. if we've already written more data
than will fit on the line, ignore the rest of the line */
- if ( DrawFullLine )
+ if ( DrawFullLine || option(OPTSTATUSONTOP))
count = (COLS < destlen ? COLS : destlen);
else
- count = ((COLS) < destlen ? (COLS) : destlen);
+ count = ((COLS-SidebarWidth) < destlen ? (COLS - SidebarWidth) : destlen);
if (count > col)
{
count -= col; /* how many columns left on this line */
}
else
{
- *wptr++ = *src++;
- wlen++;
- col++;
+ unsigned int bar = mutt_skipchars (src, "%\\");
+ char* bar2 = safe_malloc (bar+1);
+ strfcpy (bar2, src, bar+1);
+ while (bar--) {
+ *wptr++ = *src++;
+ wlen++;
+ }
+ col += mutt_strwidth (bar2);
+ FREE(&bar2);
}
}
*wptr = 0;
void state_mark_attach (STATE *s)
{
if ((s->flags & M_DISPLAY) && !mutt_strcmp (Pager, "builtin"))
- //state_puts (AttachmentMarker, s);
- ;
+ state_puts (AttachmentMarker, s);
}
void state_attach_puts (const char *t, STATE *s)