]> granicus.if.org Git - mutt/commitdiff
Simplify and fix Attach: header parsing
authorRocco Rutte <pdmef@gmx.net>
Fri, 20 Feb 2009 12:23:59 +0000 (13:23 +0100)
committerRocco Rutte <pdmef@gmx.net>
Fri, 20 Feb 2009 12:23:59 +0000 (13:23 +0100)
With ee5e696a9d08 we would skip beyond the filename to look for a
description. This changeset fixes it.

ChangeLog
headers.c

index a9c61c2c7eac3a17074ff0a0d6506b2b0fe14a91..8691de12e193330014dd642160457f8f0b75739e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-02-20 13:05 +0100  Rocco Rutte  <pdmef@gmx.net>  (b3f6d86e94f7)
+
+       * main.c: Set magic from -m before processing queries (-Q) or dumping
+       variables (-D)
+
+2009-02-20 13:02 +0100  Rocco Rutte  <pdmef@gmx.net>  (61755dc4e44c)
+
+       * ChangeLog, doc/mutt.man, init.h: Better document how the initial
+       folder is determined. Closes #3189.
+
 2009-02-15 16:09 +0100  Rocco Rutte  <pdmef@gmx.net>  (ee5e696a9d08)
 
        * doc/manual.xml.head, headers.c: Support spaces in Attach:
index ea08571586c7c0bfc8dd328dfb55e4887940c6b6..8d4a3aa5afc00e95b88421333dc3d5a70b2fcb34 100644 (file)
--- 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;
        }