X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=muttlib.c;h=876063d7908c9729b56219e1893cb62cd2ba7c66;hb=c630675d53c350801bad8f146713104be84ba997;hp=4beb99c86049c096c3e0d89b7f2b5397d1bc4243;hpb=5c310cabcfafe551dcad7638c007daae1c7d3710;p=apps%2Fmadmutt.git diff --git a/muttlib.c b/muttlib.c index 4beb99c..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,7 +1050,7 @@ 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-SidebarWidth) < destlen ? (COLS - SidebarWidth) : destlen); @@ -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;