X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Ffakemail.c;h=13976ba1e74b474aaf7c0d7d5f0fd1545643c78c;hb=eef7f95c788ee3eb5949ab481df481cbdb9bd371;hp=a78036e532f13f9512b4e9eabb968c847e9c4889;hpb=3e447015251ce6dcde843cbed10d9033d5538622;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index a78036e..13976ba 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -46,14 +46,6 @@ main (int argc, char *argv[]) return 1; } #else /* not BSD 4.2 (or newer) */ -#ifdef MSDOS -int -main (int argc, char *argv[]) -{ - return 0; -} -#else /* not MSDOS */ -/* This conditional contains all the rest of the file. */ /* These are defined in config in some versions. */ @@ -157,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 ()), \ @@ -310,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; @@ -321,8 +321,9 @@ 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'; -#ifdef WINDOWSNT + if (the_date[date_length] == '\n') + the_date[date_length] = '\0'; +#ifdef WIN32_NATIVE temp = "(null)"; #else temp = cuserid ((char *) NULL); @@ -673,5 +674,4 @@ main (int argc, char *argv[]) return close_the_streams (); } -#endif /* not MSDOS */ #endif /* not BSD 4.2 (or newer) */