#endif
#include "mutt.h"
+#include "ascii.h"
+#include "buffer.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mime.h"
#include "mx.h"
#include "attach.h"
#include "reldate.h"
+#include "svnrev.h"
#ifdef USE_IMAP
#include "imap.h"
* Renamed to mutt_adv_mktemp so I only have to change where it's
* called, and not all possible cases.
*/
-void mutt_adv_mktemp (char *s, size_t l)
+void mutt_adv_mktemp (const char* dir, char *s, size_t l)
{
char buf[_POSIX_PATH_MAX];
char tmp[_POSIX_PATH_MAX];
size_t sl;
struct stat sb;
- strfcpy (buf, NONULL (Tempdir), sizeof (buf));
+ strfcpy (buf, dir && *dir ? dir : NONULL (Tempdir), sizeof (buf));
mutt_expand_path (buf, sizeof (buf));
if (s[0] == '\0') {
snprintf (s, l, "%s/muttXXXXXX", buf);
tmp[0] = '\0';
}
- mutt_adv_mktemp (tmp, sizeof (tmp));
+ mutt_adv_mktemp (NULL, tmp, sizeof (tmp));
if (mutt_save_attachment (fp, src, tmp, 0, NULL) == -1)
return -1;
*p = 0;
}
-LIST *mutt_add_list (LIST * head, const char *data) {
- size_t len = str_len (data);
- return (mutt_add_list_n (head, data, len ? len + 1 : 0));
-}
-
-LIST *mutt_add_list_n (LIST *head, const void *data, size_t len) {
- LIST *tmp;
-
- for (tmp = head; tmp && tmp->next; tmp = tmp->next);
-
- if (tmp) {
- tmp->next = mem_malloc (sizeof (LIST));
- tmp = tmp->next;
- } else
- head = tmp = mem_malloc (sizeof (LIST));
-
- tmp->data = mem_malloc (len);
- if (len)
- memcpy (tmp->data, data, len);
- tmp->next = NULL;
- return head;
-}
-
-void mutt_free_list (LIST ** list)
-{
- LIST *p;
-
- if (!list)
- return;
- while (*list) {
- p = *list;
- *list = (*list)->next;
- mem_free (&p->data);
- mem_free (&p);
- }
-}
-
HEADER *mutt_dup_header (HEADER * h)
{
HEADER *hnew;
return mtime;
}
-const char *mutt_make_version (void)
+const char *mutt_make_version (int full)
{
static char vstring[STRING];
- snprintf (vstring, sizeof (vstring), "Mutt-ng %s (%s) based on Mutt 1.5.9",
- MUTT_VERSION, ReleaseDate);
+ if (full)
+ snprintf (vstring, sizeof (vstring), "Mutt-ng %s-%s (based "
+ "on Mutt 1.5.10/%s)", MUTT_VERSION, MUTTNG_SVNREV,
+ ReleaseDate);
+ else
+ snprintf (vstring, sizeof (vstring), "mutt-ng/%s-%s",
+ MUTT_VERSION, MUTTNG_SVNREV);
return vstring;
}