#include <utime.h>
+#include <lib-lua/lib-lua.h>
#include <lib-sys/unix.h>
#include <lib-mime/mime.h>
#include <lib-ui/sidebar.h>
+#include <lib-crypt/crypt.h>
#include "mutt.h"
+#include "pattern.h"
#include "buffy.h"
#include "mx.h"
#include "mbox.h"
#include <nntp/nntp.h>
#endif
-#include <lib-crypt/crypt.h>
-
static mx_t const *mxfmts[] = {
&mbox_mx,
&mmdf_mx,
static int invoke_dotlock (const char *path, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
- char f[SHORT_STRING + _POSIX_PATH_MAX];
- char r[SHORT_STRING];
+ char f[STRING + _POSIX_PATH_MAX];
+ char r[STRING];
+ int pos;
if (flags & DL_FL_RETRY)
snprintf (r, sizeof (r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
mutt_quote_filename (f, sizeof (f), path);
- snprintf (cmd, sizeof (cmd),
- "%s %s%s%s%s%s%s%s",
- NONULL (MuttDotlock),
+ pos = mlua_value(cmd, sizeof(cmd), "madmutt", "dotlock");
+
+ snprintf(cmd + pos, sizeof(cmd) - pos,
+ " %s%s%s%s%s%s%s",
flags & DL_FL_TRY ? "-t " : "",
flags & DL_FL_UNLOCK ? "-u " : "",
flags & DL_FL_USEPRIV ? "-p " : "",
mutt_perror (ctx->path);
else {
mutt_error (_("Couldn't lock %s\n"), ctx->path);
- safe_fclose (&ctx->fp);
+ m_fclose(&ctx->fp);
}
return (-1);
}
p_delete(&ctx->path);
p_delete(&ctx->pattern);
- if (ctx->limit_pattern)
- mutt_pattern_free (&ctx->limit_pattern);
- safe_fclose (&ctx->fp);
+ pattern_list_wipe(&ctx->limit_pattern);
+ m_fclose(&ctx->fp);
p_clear(ctx, 1);
}
int isSpool = 0;
CONTEXT f;
char mbox[_POSIX_PATH_MAX];
- char buf[SHORT_STRING];
+ char buf[STRING];
if (!ctx)
return 0;
}
if (ctx->deleted) {
- char buf[SHORT_STRING];
+ char buf[STRING];
snprintf (buf, sizeof (buf), ctx->deleted == 1
? _("Purge %d deleted message?") :
|| (*msg)->magic == M_NNTP
#endif
) {
- r = safe_fclose (&(*msg)->fp);
+ r = m_fclose(&(*msg)->fp);
}
else
(*msg)->fp = NULL;