[gnu.bash.bug] That MAILCHECK patch I sent you...

ccdn@microlab.sait.edu.au (David Newall) (02/12/90)

It was wrong (blush!).  Here's the *correct* version:


David Newall                     Phone:   +61 8 343 3160
Unix Systems Programmer          Fax:     +61 8 349 6939
Academic Computing Service       E-mail:  ccdn@levels.sait.oz{.au}
SA Institute of Technology       UUCP:    uunet!munnari!pisa.sait.oz!ccdn
The Levels, SA, 5095, Australia  VAX PSI: 505282622004::ccdn

*** variables.c.orig	Fri Feb  9 15:11:06 1990
--- variables.c	Sun Feb 11 23:17:57 1990
***************
*** 76,81 ****
--- 76,82 ----
    int string_index = 0;
    int shell_level;
    SHELL_VAR *temp_var;
+   extern int interactive;
  
    while (string = env[string_index++])
      {
***************
*** 99,126 ****
    set_if_not ("PATH", DEFAULT_PATH_VALUE);
    set_var_auto_export ("PATH");
  
!   set_if_not ("TERM", "dumb");
!   set_var_auto_export ("TERM");
  
    set_if_not ("PS1", primary_prompt);
    set_if_not ("PS2", secondary_prompt);
    set_if_not ("IFS", " \t\n");
  
!   /* Default MAILPATH, and MAILCHECK. */
!   set_if_not ("MAILCHECK", "60");
!   if ((get_string_value ("MAIL") == (char *)NULL) &&
!       (get_string_value ("MAILPATH") == (char *)NULL))
      {
!       extern char *current_user_name;
!       char *tem;
!   
!       tem = (char *)xmalloc (1 + sizeof (DEFAULT_MAIL_PATH)
!       + strlen (current_user_name));
!       strcpy (tem, DEFAULT_MAIL_PATH);
!       strcat (tem, current_user_name);
! 
!       bind_variable ("MAILPATH", tem);
!       free (tem);
      }
  
    /* Set up $PWD. */
--- 100,133 ----
    set_if_not ("PATH", DEFAULT_PATH_VALUE);
    set_var_auto_export ("PATH");
  
!   if (interactive)
!     {
!       set_if_not ("TERM", "dumb");
!       set_var_auto_export ("TERM");
!     }
  
    set_if_not ("PS1", primary_prompt);
    set_if_not ("PS2", secondary_prompt);
    set_if_not ("IFS", " \t\n");
  
!   if (interactive)
      {
!       /* Default MAILPATH, and MAILCHECK. */
!       set_if_not ("MAILCHECK", "60");
!       if ((get_string_value ("MAIL") == (char *)NULL) &&
!           (get_string_value ("MAILPATH") == (char *)NULL))
!         {
!           extern char *current_user_name;
!           char *tem;
!     
!           tem = (char *)xmalloc (1 + sizeof (DEFAULT_MAIL_PATH)
! 			       + strlen (current_user_name));
!           strcpy (tem, DEFAULT_MAIL_PATH);
!           strcat (tem, current_user_name);
!     
!           bind_variable ("MAILPATH", tem);
!           free (tem);
!         }
      }
  
    /* Set up $PWD. */