X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=muttlib.c;h=a36e8da115a6cd1d935c82bded48501150b2e573;hp=d5bd3b7ffca243a5e65d82bc22d74d5a3bfbc088;hb=7e48409c3d6fb969706114b3c0962ffa0e112d37;hpb=452ffdd4bbcd8f2dd9e4811c115824b556814ebb diff --git a/muttlib.c b/muttlib.c index d5bd3b7..a36e8da 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1262,7 +1262,6 @@ void mutt_sleep (short s) } /* Decrease a file's modification time by 1 second */ - time_t mutt_decrease_mtime (const char *f, struct stat *st) { struct utimbuf utim; @@ -1285,6 +1284,18 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st) return mtime; } +/* sets mtime of 'to' to mtime of 'from' */ +void mutt_set_mtime (const char* from, const char* to) { + struct utimbuf utim; + struct stat st; + + if (stat (from, &st) != -1) { + utim.actime = st.st_mtime; + utim.modtime = st.st_mtime; + utime (to, &utim); + } +} + const char *mutt_make_version (int full) { static char vstring[STRING];