+ value++;
+ }
+ return 0;
+}
+
+static int fold_one_header (FILE *fp, const char *tag, const char *value,
+ const char *pfx, int wraplen, int flags)
+{
+ const char *p = value, *next, *sp;
+ char buf[HUGE_STRING] = "";
+ int first = 1, enc, col = 0, w, l = 0, fold;
+
+ dprint(4,(debugfile,"mwoh: pfx=[%s], tag=[%s], flags=%d value=[%s]\n",
+ pfx, tag, flags, value));
+
+ if (fprintf (fp, "%s%s: ", NONULL (pfx), tag) < 0)
+ return -1;
+ col = mutt_strlen (tag) + 2 + mutt_strlen (pfx);
+
+ while (p && *p)
+ {
+ fold = 0;
+
+ /* find the next word and place it in `buf'. it may start with
+ * whitespace we can fold before */
+ next = find_word (p);
+ l = MIN(sizeof (buf), next - p);
+ memcpy (buf, p, l);
+ buf[l] = 0;
+
+ /* determine width: character cells for display, bytes for sending
+ * (we get pure ascii only) */
+ w = my_width (buf, col, flags);
+ enc = mutt_strncmp (buf, "=?", 2) == 0;