+2008-05-14 15:19 +0200 Samuel Tardieu <sam@rfc1149.net> (5518355bc6da)
+
+ * curs_main.c: Always update status bar after sorting method changes
+ (closes #2120).
+
+2008-05-12 23:15 -0700 Brendan Cully <brendan@kublai.com> (97aa20438c47)
+
+ * imap/imap.c: Terminate open IMAP message sets at end of mailbox
+ even if the last message is inactive. Closes #3002.
+
2008-05-11 10:52 +0200 Matthias Andree <matthias.andree@gmx.de> (09b0363cdf54)
* rfc3676.c: In debug output, cast size_t arguments to long for
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), M_FILE) != 0)
return;
mutt_expand_path (buf, sizeof (buf));
- if ((rc = fopen (buf, "a")))
+ if ((rc = fopen (buf, "a+")))
{
+ /* terminate existing file with \n if necessary */
+ if (fseek (rc, 0, SEEK_END))
+ goto fseek_err;
+ if (ftell(rc) > 0)
+ {
+ if (fseek (rc, -1, SEEK_CUR) < 0)
+ goto fseek_err;
+ if (fread(buf, 1, 1, rc) < 0)
+ {
+ mutt_perror (_("Error reading alias file"));
+ return;
+ }
+ if (fseek (rc, 0, SEEK_END) < 0)
+ goto fseek_err;
+ if (buf[0] != '\n')
+ fputc ('\n', rc);
+ }
+
if (mutt_check_alias_name (new->name, NULL))
mutt_quote_filename (buf, sizeof (buf), new->name);
else
}
else
mutt_perror (buf);
+
+ return;
+
+ fseek_err:
+ mutt_perror (_("Error seeking in alias file"));
+ fclose(rc);
+ return;
}
/*