(mbx_delimit_begin): Also write the current time.
authorGlenn Morris <rgm@gnu.org>
Wed, 11 Feb 2009 03:59:52 +0000 (03:59 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 11 Feb 2009 03:59:52 +0000 (03:59 +0000)
lib-src/ChangeLog
lib-src/movemail.c

index dc74be7..dd5c78d 100644 (file)
@@ -1,3 +1,7 @@
+2009-02-11  Glenn Morris  <rgm@gnu.org>
+
+       * movemail.c (mbx_delimit_begin): Also write the current time.
+
 2009-02-10  Glenn Morris  <rgm@gnu.org>
 
        * movemail.c (mbx_delimit_begin, mbx_delimit_end): Write mbox rather
index d452fd1..d944374 100644 (file)
@@ -683,6 +683,8 @@ xmalloc (size)
 #include <winsock.h>
 #endif
 #include <pwd.h>
+#include <string.h>
+#include <time.h>
 
 #define NOTOK (-1)
 #define OK 0
@@ -923,7 +925,16 @@ int
 mbx_delimit_begin (mbf)
      FILE *mbf;
 {
-  if (fputs ("From movemail\n", mbf) == EOF)
+  time_t now;
+  struct tm *ltime;
+  char fromline[40] = "From movemail ";
+
+  now = time (NULL);
+  ltime = localtime (&now);
+
+  strcat (fromline, asctime (ltime));
+
+  if (fputs (fromline, mbf) == EOF)
     return (NOTOK);
   return (OK);
 }