2
2
* Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
3
* Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
3
* Copyright (C) 1999-2003 Thomas Roessler <roessler@does-not-exist.org>
5
5
* This program is free software; you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
251
251
int mx_unlock_file (const char *path, int fd, int dot)
254
struct flock unlockit = { F_UNLCK, 0, 0, 0 };
254
struct flock unlockit = { F_UNLCK, 0, 0, 0, 0 };
256
256
memset (&unlockit, 0, sizeof (struct flock));
257
257
unlockit.l_type = F_UNLCK;
370
370
if (S_ISDIR (st.st_mode))
372
372
/* check for maildir-style mailbox */
374
snprintf (tmp, sizeof (tmp), "%s/cur", path);
375
if (stat (tmp, &st) == 0 && S_ISDIR (st.st_mode))
373
if (mx_is_maildir (path))
378
376
/* check for mh-style mailbox */
380
snprintf (tmp, sizeof (tmp), "%s/.mh_sequences", path);
381
if (access (tmp, F_OK) == 0)
384
snprintf (tmp, sizeof (tmp), "%s/.xmhcache", path);
385
if (access (tmp, F_OK) == 0)
388
snprintf (tmp, sizeof (tmp), "%s/.mew_cache", path);
389
if (access (tmp, F_OK) == 0)
392
snprintf (tmp, sizeof (tmp), "%s/.mew-cache", path);
393
if (access (tmp, F_OK) == 0)
396
snprintf (tmp, sizeof (tmp), "%s/.sylpheed_cache", path);
397
if (access (tmp, F_OK) == 0)
401
* ok, this isn't an mh folder, but mh mode can be used to read
402
* Usenet news from the spool. ;-)
405
snprintf (tmp, sizeof (tmp), "%s/.overview", path);
406
if (access (tmp, F_OK) == 0)
410
380
else if (st.st_size == 0)
856
826
isSpool = mutt_is_spool (ctx->path) && !mutt_is_spool (mbox);
859
if (isSpool && mbox && *mbox)
829
if (isSpool && *mbox)
861
831
mutt_expand_path (mbox, sizeof (mbox));
862
832
snprintf (buf, sizeof (buf), _("Move read messages to %s?"), mbox);
993
mutt_message (_("%d kept, %d moved, %d deleted."),
994
ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
996
mutt_message (_("%d kept, %d deleted."),
997
ctx->msgcount - ctx->deleted, ctx->deleted);
967
mutt_message (_("%d kept, %d moved, %d deleted."),
968
ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
970
mutt_message (_("%d kept, %d deleted."),
971
ctx->msgcount - ctx->deleted, ctx->deleted);
999
974
if (ctx->msgcount == ctx->deleted &&
1000
975
(ctx->magic == M_MMDF || ctx->magic == M_MBOX) &&
1165
1141
#ifdef USE_IMAP
1166
1142
if (ctx->magic == M_IMAP && !purge)
1167
mutt_message _("Mailbox checkpointed.");
1145
mutt_message _("Mailbox checkpointed.");
1170
mutt_message (_("%d kept, %d deleted."), msgcount - deleted,
1151
mutt_message (_("%d kept, %d deleted."), msgcount - deleted,
1173
1155
mutt_sleep (0);
1208
1190
/* {maildir,mh}_open_new_message are in mh.c. */
1210
int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1192
static int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1212
1194
msg->fp = dest->fp;
1216
1198
#ifdef USE_IMAP
1217
int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1199
static int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1219
1201
char tmp[_POSIX_PATH_MAX];