XEmacs 21.4.22.
[chise/xemacs-chise.git.1] / lib-src / fakemail.c
index 0bf4ca4..13976ba 100644 (file)
@@ -149,9 +149,17 @@ extern int fclose (), pclose ();
 extern char *malloc (), *realloc ();
 #endif
 
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 400000
+#define CURRENT_USER
+#endif
+
 #ifdef CURRENT_USER
 extern struct passwd *getpwuid ();
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 400000
+extern uid_t geteuid ();
+#else
 extern unsigned short geteuid ();
+#endif
 static struct passwd *my_entry;
 #define cuserid(s)                             \
 (my_entry = getpwuid ((int) geteuid ()),       \
@@ -302,7 +310,7 @@ static line_list
 make_file_preface (void)
 {
   char *the_string, *temp;
-  long idiotic_interface;
+  time_t idiotic_interface;
   long prefix_length;
   long user_length;
   long date_length;
@@ -313,7 +321,8 @@ make_file_preface (void)
   the_date = ctime (&idiotic_interface);
   /* the_date has an unwanted newline at the end */
   date_length = strlen (the_date) - 1;
-  the_date[date_length] = '\0';
+  if (the_date[date_length] == '\n')
+    the_date[date_length] = '\0';
 #ifdef WIN32_NATIVE
   temp = "(null)";
 #else