add_snipped() was too agressive with automatic removal of spaces.
+void
+add_snippet_raw(char **ppos, char *term, char *add)
+{
+ char *pos = *ppos;
+ while (pos < term && *add)
+ *pos++ = *add++;
+ *ppos = pos;
+ *pos = 0;
+}
+
void
add_subject_snippet(char **ppos, char *term, char *add)
{
void
add_subject_snippet(char **ppos, char *term, char *add)
{
add_subject_snippet(ppos, term, add);
return;
}
add_subject_snippet(ppos, term, add);
return;
}
- // debug("%s: pers=%s mbox=%s\n", add, addr->personal, addr->mailbox);
rfc2047_decode(&addr->personal);
rfc2047_decode(&addr->personal);
+ // debug("%s: pers=%s mbox=%s\n", add, addr->personal, addr->mailbox);
if (!addr->mailbox || !addr->mailbox[0])
add_mbox = 0;
if (!addr->personal || !addr->personal[0])
if (!addr->mailbox || !addr->mailbox[0])
add_mbox = 0;
if (!addr->personal || !addr->personal[0])
if (add_personal)
add_snippet(ppos, term, addr->personal);
if (add_mbox && add_personal)
if (add_personal)
add_snippet(ppos, term, addr->personal);
if (add_mbox && add_personal)
- add_snippet(ppos, term, " <");
+ add_snippet_raw(ppos, term, " <");
if (add_mbox)
add_snippet(ppos, term, addr->mailbox);
if (add_mbox && add_personal)
if (add_mbox)
add_snippet(ppos, term, addr->mailbox);
if (add_mbox && add_personal)
- add_snippet(ppos, term, ">");
+ add_snippet_raw(ppos, term, ">");
- add_snippet(ppos, term, "???");
+ add_snippet_raw(ppos, term, "???");
rfc822_free_address(&addr);
}
rfc822_free_address(&addr);
}
void add_subject_snippet(char **ppos, char *term, char *add);
void add_addr_snippet(char **ppos, char *term, char *add, int add_mbox, int add_personal);
void add_snippet(char **ppos, char *term, char *add);
void add_subject_snippet(char **ppos, char *term, char *add);
void add_addr_snippet(char **ppos, char *term, char *add, int add_mbox, int add_personal);
void add_snippet(char **ppos, char *term, char *add);
+void add_snippet_raw(char **ppos, char *term, char *add);
if (subject[0])
add_subject_snippet(&pos, term, subject);
else
if (subject[0])
add_subject_snippet(&pos, term, subject);
else
- add_snippet(&pos, term, "No subject");
+ add_snippet_raw(&pos, term, "No subject");
if (b->sender_snippet[0])
{
add_snippet(&buf, term, b->sender_snippet);
if (b->sender_snippet[0])
{
add_snippet(&buf, term, b->sender_snippet);
- add_snippet(&buf, term, ": ");
+ add_snippet_raw(&buf, term, ": ");
}
add_snippet(&buf, term, b->subject_snippet);
}
}
add_snippet(&buf, term, b->subject_snippet);
}