summaryrefslogtreecommitdiffstats
path: root/headers.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-02-20 13:23:59 +0100
committerRocco Rutte <pdmef@gmx.net>2009-02-20 13:23:59 +0100
commit253546c8dea8c99ca9a79681de1bae6d2def0029 (patch)
tree4637f96f940543359e409f6cbee58a536944878e /headers.c
parent5f6c6da8d4cfa42d35d190f4c28fb4dadda1e884 (diff)
Simplify and fix Attach: header parsing
With ee5e696a9d08 we would skip beyond the filename to look for a description. This changeset fixes it.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/headers.c b/headers.c
index ea085715..8d4a3aa5 100644
--- a/headers.c
+++ b/headers.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1996-2009 Michael R. Elkins <me@mutt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -147,32 +147,32 @@ void mutt_edit_headers (const char *editor,
{
BODY *body;
BODY *parts;
- char *q;
int l = 0;
p = cur->data + 7;
SKIPWS (p);
if (*p)
{
- for (q = p; *q && *q != ' ' && *q != '\t'; q++)
+ for ( ; *p && *p != ' ' && *p != '\t'; p++)
{
- if (*q == '\\')
+ if (*p == '\\')
{
- if (!*(q+1))
+ if (!*(p+1))
break;
- q++;
+ p++;
}
if (l < sizeof (path) - 1)
- path[l++] = *q;
+ path[l++] = *p;
}
- *q++ = 0;
- SKIPWS (q);
+ if (*p)
+ *p++ = 0;
+ SKIPWS (p);
path[l] = 0;
mutt_expand_path (path, sizeof (path));
if ((body = mutt_make_file_attach (path)))
{
- body->description = safe_strdup (q);
+ body->description = safe_strdup (p);
for (parts = msg->content; parts->next; parts = parts->next) ;
parts->next = body;
}