return;
}
- mtime = mutt_decrease_mtime (path, &st);
+ mtime = m_decrease_mtime(path, &st);
mutt_edit_file (editor, path);
stat (path, &st);
#include "lib-lib.h"
+#include <utime.h>
+
#ifndef O_NOFOLLOW
# define O_NOFOLLOW 0
#endif
/****************************************************************************/
-/* ligben-like funcs */
+/* path manipulations */
/****************************************************************************/
const char *mutt_basename(const char *f)
int fd = m_tempfd(dst, n, dir, fmt);
return fd < 0 ? NULL : fdopen(fd, "w+");
}
+
+/****************************************************************************/
+/* misc */
+/****************************************************************************/
+
+/* Decrease a file's modification time by 1 second */
+time_t m_decrease_mtime(const char *path, struct stat *st)
+{
+ struct utimbuf utim;
+ struct stat _st;
+ time_t mtime;
+
+ if (!st) {
+ if (stat(path, &_st) == -1)
+ return -1;
+ st = &_st;
+ }
+
+ if ((mtime = st->st_mtime) == time(NULL)) {
+ mtime -= 1;
+ utim.actime = mtime;
+ utim.modtime = mtime;
+ utime(path, &utim);
+ }
+
+ return mtime;
+}
+
int mutt_copy_bytes(FILE *, FILE *, ssize_t);
/****************************************************************************/
-/* ligben-like funcs */
+/* path manipulations */
/****************************************************************************/
const char *mutt_basename(const char *);
int m_tempfd(char *dst, ssize_t n, const char *dir, const char *fmt);
FILE *m_tempfile(char *dst, ssize_t n, const char *dir, const char *fmt);
+/****************************************************************************/
+/* misc */
+/****************************************************************************/
+
+time_t m_decrease_mtime(const char *f, struct stat *st);
+
#endif /* MUTT_LIB_LIB_FILE_H */
#include <grp.h>
#include <pwd.h>
-#include <utime.h>
#include <lib-mime/mime.h>
#include <lib-ui/curses.h>
sleep(MAX(s, SleepTime));
}
-/* Decrease a file's modification time by 1 second */
-time_t mutt_decrease_mtime (const char *f, struct stat *st)
-{
- struct utimbuf utim;
- struct stat _st;
- time_t mtime;
-
- if (!st) {
- if (stat (f, &_st) == -1)
- return -1;
- st = &_st;
- }
-
- if ((mtime = st->st_mtime) == time (NULL)) {
- mtime -= 1;
- utim.actime = mtime;
- utim.modtime = mtime;
- utime (f, &utim);
- }
-
- return mtime;
-}
-
const char *mutt_make_version (int full)
{
static char vstring[STRING];
int mutt_cmp_header (const HEADER*, const HEADER*);
-time_t mutt_decrease_mtime (const char *, struct stat *);
int is_from (const char *, char *, ssize_t, time_t *);
const char *mutt_charset_hook (const char *);
*/
#include <lib-lib/lib-lib.h>
-#include <utime.h>
#include <lib-mime/mime.h>
#include <lib-mime/rfc3676.h>
if (!(flags & SENDBATCH)) {
struct stat st;
- time_t mtime = mutt_decrease_mtime (msg->content->filename, NULL);
+ time_t mtime = m_decrease_mtime(msg->content->filename, NULL);
mutt_update_encoding (msg->content);