summaryrefslogtreecommitdiffstats
path: root/headers.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-02-15 16:09:50 +0100
committerRocco Rutte <pdmef@gmx.net>2009-02-15 16:09:50 +0100
commit524801d9c4c190087be05f4ff4ca0b37131a3484 (patch)
tree9bed097c2f93a023e7d2b54b2b430a91180bd909 /headers.c
parentee0dd99ef44452feac8f6fb43293e5c2d7a98b58 (diff)
Support spaces in Attach: pseudoheader. Closes #3179.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/headers.c b/headers.c
index 0aa79154..ea085715 100644
--- a/headers.c
+++ b/headers.c
@@ -148,18 +148,27 @@ void mutt_edit_headers (const char *editor,
BODY *body;
BODY *parts;
char *q;
+ int l = 0;
p = cur->data + 7;
SKIPWS (p);
if (*p)
{
- if ((q = strpbrk (p, " \t")))
+ for (q = p; *q && *q != ' ' && *q != '\t'; q++)
{
- mutt_substrcpy (path, p, q, sizeof (path));
- SKIPWS (q);
+ if (*q == '\\')
+ {
+ if (!*(q+1))
+ break;
+ q++;
+ }
+ if (l < sizeof (path) - 1)
+ path[l++] = *q;
}
- else
- strfcpy (path, p, sizeof (path));
+ *q++ = 0;
+ SKIPWS (q);
+ path[l] = 0;
+
mutt_expand_path (path, sizeof (path));
if ((body = mutt_make_file_attach (path)))
{