Changeset 5137:0c47f7b06158 for muttlib.c
Legend:
- Unmodified
- Added
- Removed
-
muttlib.c
r5098 r5137 992 992 void mutt_FormatString (char *dest, /* output buffer */ 993 993 size_t destlen, /* output buffer len */ 994 size_t col, /* starting column (nonzero when called recursively) */ 994 995 const char *src, /* template string */ 995 996 format_t *callback, /* callback for processing */ … … 999 1000 char prefix[SHORT_STRING], buf[LONG_STRING], *cp, *wptr = dest, ch; 1000 1001 char ifstring[SHORT_STRING], elsestring[SHORT_STRING]; 1001 size_t wlen, count, len, col,wid;1002 size_t wlen, count, len, wid; 1002 1003 pid_t pid; 1003 1004 FILE *filter; … … 1008 1009 destlen--; /* save room for the terminal \0 */ 1009 1010 wlen = (flags & M_FORMAT_ARROWCURSOR && option (OPTARROWCURSOR)) ? 3 : 0; 1010 col = wlen;1011 col += wlen; 1011 1012 1012 1013 if ((flags & M_FORMAT_NOFILTER) == 0) … … 1056 1057 dprint(3, (debugfile, "fmtpipe %2d: %s\n", i++, word->data)); 1057 1058 mutt_buffer_addch(command, '\''); 1058 mutt_FormatString(buf, sizeof(buf), word->data, callback, data,1059 mutt_FormatString(buf, sizeof(buf), 0, word->data, callback, data, 1059 1060 flags | M_FORMAT_NOFILTER); 1060 1061 for (p = buf; p && *p; p++) … … 1075 1076 dprint(3, (debugfile, "fmtpipe > %s\n", command->data)); 1076 1077 1078 col -= wlen; /* reset to passed in value */ 1077 1079 wptr = dest; /* reset write ptr */ 1078 1080 wlen = (flags & M_FORMAT_ARROWCURSOR && option (OPTARROWCURSOR)) ? 3 : 0; … … 1101 1103 if (recycler) 1102 1104 { 1103 mutt_FormatString(dest, destlen++, recycler, callback, data, flags);1105 mutt_FormatString(dest, destlen++, col, recycler, callback, data, flags); 1104 1106 FREE(&recycler); 1105 1107 } … … 1204 1206 { 1205 1207 count -= col; /* how many columns left on this line */ 1206 mutt_FormatString (buf, sizeof (buf), src, callback, data, flags);1208 mutt_FormatString (buf, sizeof (buf), 0, src, callback, data, flags); 1207 1209 len = mutt_strlen (buf); 1208 1210 wid = mutt_strwidth (buf); … … 1254 1256 1255 1257 /* use callback function to handle this case */ 1256 src = callback (buf, sizeof (buf), c h, src, prefix, ifstring, elsestring, data, flags);1258 src = callback (buf, sizeof (buf), col, ch, src, prefix, ifstring, elsestring, data, flags); 1257 1259 1258 1260 if (tolower)
