X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=muttlib.c;h=757c34fdaeb7255bbf230202fdfa98009521fc17;hp=b55dfda5a7882c22cb32657dc6c09ff837074463;hb=ae93bc030d3794817980fc58a9cb20185047dd26;hpb=364bf52ada05bf7d7158dba9d2391f63b71258f6 diff --git a/muttlib.c b/muttlib.c index b55dfda..757c34f 100644 --- a/muttlib.c +++ b/muttlib.c @@ -23,7 +23,7 @@ #include "attach.h" #include "reldate.h" -#include "svnrev.h" +#include "version.h" #ifdef USE_IMAP #include "imap.h" @@ -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,17 +1284,29 @@ 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]; if (full) - snprintf (vstring, sizeof (vstring), "Mutt-ng %s-%s (based " - "on Mutt 1.5.10/%s)", MUTT_VERSION, MUTTNG_SVNREV, + snprintf (vstring, sizeof (vstring), "Mutt-ng %s-r%s (based " + "on Mutt 1.5.11/%s)", MUTT_VERSION, MUTT_REVISION, ReleaseDate); else - snprintf (vstring, sizeof (vstring), "mutt-ng/%s-%s", - MUTT_VERSION, MUTTNG_SVNREV); + snprintf (vstring, sizeof (vstring), "mutt-ng/%s-r%s", + MUTT_VERSION, MUTT_REVISION); return vstring; } @@ -1343,7 +1354,7 @@ int mutt_match_spam_list (const char *s, SPAM_LIST * l, char *text, int x) for (p = l->template; *p;) { if (*p == '%') { n = atoi (++p); /* find pmatch index */ - while (isdigit (*p)) + while (isdigit ((unsigned char) *p)) ++p; /* skip subst token */ for (i = pmatch[n].rm_so; (i < pmatch[n].rm_eo) && (tlen < x); i++) text[tlen++] = s[i];