X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=muttlib.c;h=876063d7908c9729b56219e1893cb62cd2ba7c66;hp=2e34fadc7fdfc0a8eed9b476788731932d82e55c;hb=85486f8623f6d9a12f7b251445ac9d203d3ae348;hpb=b661011c5210796beaf103676c0d24b87f1a2787 diff --git a/muttlib.c b/muttlib.c index 2e34fad..876063d 100644 --- a/muttlib.c +++ b/muttlib.c @@ -456,6 +456,13 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) } break; + case '^': + { + strfcpy (p, NONULL(CurrentFolder), sizeof (p)); + tail = s + 1; + } + break; + default: { *p = '\0'; @@ -929,6 +936,23 @@ void mutt_safe_path (char *s, size_t l, ADDRESS *a) *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 */ @@ -1026,10 +1050,10 @@ void mutt_FormatString (char *dest, /* output buffer */ 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 */ @@ -1136,9 +1160,15 @@ void mutt_FormatString (char *dest, /* output buffer */ } 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; @@ -1329,8 +1359,7 @@ int state_printf (STATE *s, const char *fmt, ...) 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)