X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Ffakemail.c;h=13976ba1e74b474aaf7c0d7d5f0fd1545643c78c;hb=c17cfefd00f49430bd139e11bfc580734091d728;hp=0bf4ca4c58c3a8c49c1c3beb051b041df59dd5b1;hpb=762383636a99307282c2d93d26c35c046ec24da1;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 0bf4ca4..13976ba 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -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