[Prev][Next][Index][Thread]

Re: bash login mail notification



On Wed, 3 Dec 1997, Bullwinkle J. Moose wrote:

> Before I start hacking code, has anyone modified bash to read from
> ~/Mailbox at login time to see if the user has /(new|no)?mail/;  ?

	Attached is a patch I made against bash 2.01.1.  This is part of a
bigger patch that I made, and I cut-and-pasted this from it.  I haven't
test this trimmed-down patch, but as far as I can tell it should patch
cleanly.

					-Dustin Marquess

--- bash-2.01.1/config.h	Sun Nov 30 06:01:46 1997
+++ bash-2.01.1/config.h	Sun Nov 30 06:02:46 1997
@@ -318,7 +318,7 @@
 
 #define HAVE_POSIX_SIGSETJMP 1
 
-#define DEFAULT_MAIL_DIRECTORY "/usr/spool/mail
+#define DEFAULT_MAIL_FILE "Mailbox"
 
 /* Define if you have the bcopy function.  */
 #define HAVE_BCOPY 1
--- bash-2.01.1/mailcheck.c	Fri Jul 18 17:59:48 1997
+++ bash-2.01.1/mailcheck.c	Sun Nov 30 06:02:18 1997
@@ -291,10 +291,10 @@
 {
   char *mp;
 
-  mp = xmalloc (2 + sizeof (DEFAULT_MAIL_DIRECTORY) + strlen (current_user.user_name));
-  strcpy (mp, DEFAULT_MAIL_DIRECTORY);
-  mp[sizeof(DEFAULT_MAIL_DIRECTORY) - 1] = '/';
-  strcpy (mp + sizeof (DEFAULT_MAIL_DIRECTORY), current_user.user_name);
+  mp = xmalloc (2 + sizeof (DEFAULT_MAIL_FILE) + strlen (current_user.home_dir));
+  strcpy (mp, current_user.home_dir);
+  mp[sizeof(current_user.home_dir)] = '/';
+  strcpy (mp + sizeof (current_user.home_dir) + 1, DEFAULT_MAIL_FILE);
   return (mp);
 }
 

References: