we always want to DOTLOCK mboxes.
[apps/madmutt.git] / lib-mime / rfc3676.c
index 7350188..404b02b 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <lib-lib/lib-lib.h>
 
+#include <utime.h>
+
 #include <lib-ui/curses.h>
 
 #include "state.h"
@@ -200,6 +202,18 @@ int rfc3676_handler (BODY * a, STATE * s) {
   return (0);
 }
 
+/* sets mtime of 'to' to mtime of 'from' */
+static 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);
+  }
+}
+
 void rfc3676_space_stuff (HEADER* hdr) {
   FILE* in = NULL, *out = NULL;
   char buf[LONG_STRING];
@@ -217,7 +231,7 @@ void rfc3676_space_stuff (HEADER* hdr) {
   }
 
   while (fgets (buf, sizeof (buf), in)) {
-    if (ascii_strncmp ("From ", buf, 4) == 0 || buf[0] == ' ') {
+    if (m_strncmp("From ", buf, 4) == 0 || buf[0] == ' ') {
       fputc (' ', out);
     }
     fputs (buf, out);