[comp.mail.mush] Official Patch #3 for Mush 7.0

schaefer@ogicse.ogc.edu (Barton E. Schaefer) (12/23/89)

@OFF

OK, so I lied about patch #2 being the last before the new year.

This is Official Patch #3 for Mush 7.0.  It REALLY TRULY WILL be the last
patch before the new year; Dan Heller is out of the country until Jan. 5
and I will be in Iowa from Dec. 24 to Jan. 6.  

As usual, fully up-to-date versions are available for anonymous ftp from:

	    ucbvax.berkeley.edu: pub/mailers/mush-7.0.tar.Z

		cse.ogi.edu: pub/mush/mush-7.0.tar.Z

If you missed Official Patch #1 or #2, you can obtain them via E-mail by
sending a message to me:

	    <schaefer@cse.ogi.edu>
    or
	    {harvard,rutgers,garp,decwrl,ucsd,unmvax}!ogicse!schaefer

Include in your message a line of the form

@PATCH patch-number path-from-ogicse-to-you

This is my personal account, folks, so messages with one-word requests
like "help" or "index" won't get any response unless I send it by hand.
(Which I won't be here to do for the next two weeks.)

To recieve a complete set of mush sources, use

@MUSH path-from-ogicse-to-you

The mush sources are mailed as a compressed tarfile, encoded for
shipping with the "btoa" utility and "split" into 9 parts.  Some sites
in Europe are losing characters in shipment, so if anybody over there
has the sources and would like to make them available, please do so,
and post an announcement here.

Note that ogicse is still having some sendmail.cf troubles, so the
path-from-ogicse-to-you must either be an Internet address (no mixing
of !-paths and @-domains) or a uucp path that begins with a well-known
(and preferably connected-to-ogicse) host.  The mail server is now
able to do some uucp hostname lookups on its own, so hopefully there
will be few difficulties.

To keep /usr/spool/mail and my home disk partition from filling up with
bounced messages while I'm gone, mush will be running from at(1) once a
day and throwing away anything that looks like pieces of a mush tarmail,
so if you don't get your sources within a few days, try again with a
different path-from-ogicse-to-you.

Changes/fixes in this patch:

    Some more minor cleanup of glob.c, mostly for benefit of the standalone
    globber that can be built with -DTEST.

    <Next> and <Prev> scrolling buttons in tool mode are now displayed
    whenever they are useful; previously, some messages could become
    unreachable when toggling from hide-deleted to show-deleted.

    SunOS 3.5 suffers from a lack of file descriptors; the limit is 32
    and mush's main frame alone consumes 25.  This caused fairly frequent
    core dumping in the SunView libraries when opening other windows for
    help etc.  Fixed by forcing help texts to go to the message display
    subwindow instead of opening their own new window.  This applies to
    SunOS 3.5 ONLY!  SunOS 4.0+ will still have help in a separate new
    window.  It may still be impossible to use <Aliases> and <Options>
    screens while composing a letter under 3.5.  Thanks to Bill Randle
    for help tracking this down.

    Some typos fixed in the man page.  Thanks to Larry Virden for proofing.

    Fixed printing (feedback messages from mush) in tool mode so it'll go
    to the correct window *all* the time.

    Enlarged a too-small buffer in tool mode <Respond> that was causing
    core dumps on SunOS 4.0.1.  Thanks to Shaun T. Erickson for a useful
    stack trace.

*** /tmp/,RCSt1024261	Fri Dec 22 09:55:29 1989
--- glob.c	Thu Dec 21 10:35:36 1989
***************
*** 20,26 ****
  #define max(x,y) ((x) > (y) ? (x) : (y))
  #endif /* max */
  #ifndef min
! #define min(x,y) ((x) > (y) ? (y) : (x));
  #endif /* min */
  #define xfree free
  #undef wprint
--- 20,26 ----
  #define max(x,y) ((x) > (y) ? (x) : (y))
  #endif /* max */
  #ifndef min
! #define min(x,y) ((x) > (y) ? (y) : (x))
  #endif /* min */
  #define xfree free
  #undef wprint
***************
*** 175,180 ****
--- 175,182 ----
      char **t1, **t2;
      int n, new, cnt;
  
+     if (!exp)
+ 	return -1;
      if (!pat || !*pat)
  	return 0;
  
***************
*** 492,498 ****
      oldpat[i] = NULL;
      if (i > 0 && mat) {
  	*mat = (char **)malloc((unsigned)((i + 1) * sizeof(char *)));
! 	(*mat)[i] = NULL;
  	ret = i;
      }
      while (!mat && i-- > 0)
--- 494,503 ----
      oldpat[i] = NULL;
      if (i > 0 && mat) {
  	*mat = (char **)malloc((unsigned)((i + 1) * sizeof(char *)));
! 	if (*mat)
! 	    (*mat)[i] = NULL;
! 	else
! 	    return -1;
  	ret = i;
      }
      while (!mat && i-- > 0)
***************
*** 778,784 ****
  
        dir.d_fileno = dp->od_ino ;
        strncpy(dir.d_name, dp->od_name, ODIRSIZ) ;
!       dir.d_name[ODIRSIZ] = ' ' ;       /* Ensure termination. */
        dir.d_namlen = strlen(dir.d_name) ;
        dir.d_reclen = DIRSIZ(&dir) ;
        return(&dir) ;
--- 783,789 ----
  
        dir.d_fileno = dp->od_ino ;
        strncpy(dir.d_name, dp->od_name, ODIRSIZ) ;
!       dir.d_name[ODIRSIZ] = '\0' ;       /* Ensure termination. */
        dir.d_namlen = strlen(dir.d_name) ;
        dir.d_reclen = DIRSIZ(&dir) ;
        return(&dir) ;
*** /tmp/,RCSt1024261	Fri Dec 22 09:55:31 1989
--- hdrs.c	Fri Dec 22 09:44:11 1989
***************
*** 245,254 ****
  #ifdef SUNTOOL
      if (istool) {
  	extern Panel_item next_scr, prev_scr;
! 	if (msg_cnt > screen) {
! 	    (void) panel_set(next_scr, PANEL_SHOW_ITEM, TRUE, NULL);
  	    (void) panel_set(prev_scr, PANEL_SHOW_ITEM, TRUE, NULL);
! 	}
  	mail_status(0);
      }
  #endif /* SUNTOOL */
--- 245,258 ----
  #ifdef SUNTOOL
      if (istool) {
  	extern Panel_item next_scr, prev_scr;
! 	if (n_array[0] > 0)
  	    (void) panel_set(prev_scr, PANEL_SHOW_ITEM, TRUE, NULL);
! 	else
! 	    (void) panel_set(prev_scr, PANEL_SHOW_ITEM, FALSE, NULL);
! 	if (n_array[screen - 1] < msg_cnt - 1)
! 	    (void) panel_set(next_scr, PANEL_SHOW_ITEM, TRUE, NULL);
! 	else
! 	    (void) panel_set(next_scr, PANEL_SHOW_ITEM, FALSE, NULL);
  	mail_status(0);
      }
  #endif /* SUNTOOL */
*** /tmp/,RCSt1024261	Fri Dec 22 09:55:39 1989
--- misc.c	Fri Dec 22 09:21:35 1989
***************
*** 75,81 ****
--- 75,84 ----
      /* If no file given, take "str" arg as message to print */
      if (!file || !*file) {
  #ifdef SUNTOOL
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
+ 	/* SunOS 3.5 doesn't have enough file descriptors */
  	turnon(glob_flags, NEW_FRAME);
+ #endif /* ALERT_ATTR */
  	strdup(more_prompt, "help");
  #endif /* SUNTOOL */
  	/* use the pager on the args to the function */
***************
*** 103,109 ****
--- 106,115 ----
  	print("There is no help found for \"%s\".\n", (char *)str);
      else {
  #ifdef SUNTOOL
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
+ 	/* SunOS 3.5 doesn't have enough file descriptors */
  	turnon(glob_flags, NEW_FRAME);
+ #endif /* ALERT_ATTR */
  	strdup(more_prompt, sprintf(buf, "%s help", (char *)str));
  #endif /* SUNTOOL */
  	(void) do_pager(NULL, TRUE);
*** /tmp/,RCSt1024261	Fri Dec 22 09:55:40 1989
--- msgs.c	Wed Dec 20 12:27:03 1989
***************
*** 247,253 ****
       */
      if (!first && mail_size()) {
  lost_lock:
! 	if (get_new_mail(TRUE) && show_new_mail()) {
  	    char buf[80];
  	    if (iscurses)
  		putchar('\n'), turnon(glob_flags, CNTD_CMD);
--- 247,254 ----
       */
      if (!first && mail_size()) {
  lost_lock:
! 	if (get_new_mail(TRUE) && isoff(glob_flags, REDIRECT)
! 		&& show_new_mail()) {
  	    char buf[80];
  	    if (iscurses)
  		putchar('\n'), turnon(glob_flags, CNTD_CMD);
*** /tmp/,RCSt1024261	Fri Dec 22 09:55:43 1989
--- mush.1	Fri Dec 22 09:33:51 1989
***************
*** 330,336 ****
  curses mode, or the tool mode, this option is ignored.
  .SH INITIALIZATION
  After the command line arguments have been interpreted
! .B Mush
  will read commands from one or more
  .B "initialization files"
  that (typically) set variable values, aliases, command line aliases,
--- 330,336 ----
  curses mode, or the tool mode, this option is ignored.
  .SH INITIALIZATION
  After the command line arguments have been interpreted
! .I Mush
  will read commands from one or more
  .B "initialization files"
  that (typically) set variable values, aliases, command line aliases,
***************
*** 1025,1031 ****
  RIGHT mouse button (the \*Qmenu button\*U) and a number of items will appear
  in a menu.
  The last command in the menu list will be one labelled \*Qhelp\*U.
! Selecting this menu item will display help information in the message window.
  .SH "LINE-MODE INTERFACE"
  In the line-mode, the user is given a prompt to which commands are issued
  and arguments are passed to commands.
--- 1025,1035 ----
  RIGHT mouse button (the \*Qmenu button\*U) and a number of items will appear
  in a menu.
  The last command in the menu list will be one labelled \*Qhelp\*U.
! Selecting this menu item will open a new scrollable window with help text.
! .I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
! Mush
! .IR "to display help information in the message window in the main frame" .
! .ft R
  .SH "LINE-MODE INTERFACE"
  In the line-mode, the user is given a prompt to which commands are issued
  and arguments are passed to commands.
***************
*** 1632,1637 ****
--- 1636,1645 ----
  labelled \*Qhelp\*U.
  When this item is chosen, an new window is opened where help for that
  command is displayed.
+ .I "Note:  The limited number of file descriptors in SunOS 3.5 forces"
+ Mush
+ .IR "to display help information in the message window in the main frame" .
+ .ft R
  .PP
  When composing letters,
  a separate frame is created which includes a panel of command items,
***************
*** 1862,1868 ****
  When used in an initialization file (such as
  .IR .mushrc )
  this command is the same as giving the \-C (\-curses) switch on the
! .I mush
  command line.
  .sp
  The argument
--- 1870,1876 ----
  When used in an initialization file (such as
  .IR .mushrc )
  this command is the same as giving the \-C (\-curses) switch on the
! .B mush
  command line.
  .sp
  The argument
***************
*** 2888,2894 ****
  will append each message to the end of the file.
  If \-f is given, then the file is overwritten causing whatever contents it
  contains to be lost.
! For compatibility with older versions, the character `!' may be subsitituted
  for \-f (no `\-' is used with `!').
  If the current folder is the system mailbox, then saved messages are
  marked for deletion when the user exits using the
--- 2896,2902 ----
  will append each message to the end of the file.
  If \-f is given, then the file is overwritten causing whatever contents it
  contains to be lost.
! For compatibility with older versions, the character `!' may be substituted
  for \-f (no `\-' is used with `!').
  If the current folder is the system mailbox, then saved messages are
  marked for deletion when the user exits using the
***************
*** 3535,3541 ****
  .ti +2
  To: fred, wilma
  .sp
! Then the file ~/flinstone.sig will be used.
  However, if the address were:
  .sp
  .ti +2
--- 3543,3549 ----
  .ti +2
  To: fred, wilma
  .sp
! Then the file ~/flintstone.sig will be used.
  However, if the address were:
  .sp
  .ti +2
***************
*** 3576,3582 ****
  .IR "completion character" ;
  if
  .B complete
! is set, but not to a value, the escape characer is used as the default.
  When the completion character is typed at the end of a word prefix,
  .I Mush
  will interactively complete that word.
--- 3584,3590 ----
  .IR "completion character" ;
  if
  .B complete
! is set, but not to a value, the escape character is used as the default.
  When the completion character is typed at the end of a word prefix,
  .I Mush
  will interactively complete that word.
***************
*** 3722,3729 ****
  You may have as many To: and Cc: headers as you like.
  .sp
  The From: header normally should not be changed.
! If you change this header to an address that mush is unable to identify as
! authentic, mush will silently put back the original From: header.
  .sp
  The Date: header will always be replaced by one with a more accurate
  time and date stamp.
--- 3730,3739 ----
  You may have as many To: and Cc: headers as you like.
  .sp
  The From: header normally should not be changed.
! If you change this header to an address that
! .I Mush
! is unable to identify as
! authentic, the original From: header will silently be put back.
  .sp
  The Date: header will always be replaced by one with a more accurate
  time and date stamp.
***************
*** 4634,4640 ****
  If \fIMush\fR was started with the \-e (echo mode) option, or is in tool mode,
  line wrapping cannot be done due to I/O incompatibilities.
  .PP
! In addtion to the named variables described above, three special
  variable forms are recognized.
  .TP
  .B $$
--- 4644,4650 ----
  If \fIMush\fR was started with the \-e (echo mode) option, or is in tool mode,
  line wrapping cannot be done due to I/O incompatibilities.
  .PP
! In addition to the named variables described above, three special
  variable forms are recognized.
  .TP
  .B $$
***************
*** 5330,5336 ****
  fred@flintstone.bed.rock (Fred Flintstone, Cave Man)
  .sp
  If the comment contains unbalanced quotes, unpredictable results may occur
! (Mush won't deliver the mail).
  .sp
  Since the angle brackets have the highest precedence, quotes or parentheses
  may be used in conjunction with one another.
--- 5340,5347 ----
  fred@flintstone.bed.rock (Fred Flintstone, Cave Man)
  .sp
  If the comment contains unbalanced quotes, unpredictable results may occur
! .RI ( Mush
! won't deliver the mail).
  .sp
  Since the angle brackets have the highest precedence, quotes or parentheses
  may be used in conjunction with one another.
*** /tmp/,RCSt1024261	Fri Dec 22 09:56:02 1989
--- print.c	Thu Dec 21 17:36:04 1989
***************
*** 149,155 ****
  	return;
      }
  #ifdef SUNTOOL
!     if (window_get(compose_frame, FRAME_CLOSED))
          wprint_sw = mfprint_sw;
      else
          wprint_sw = cprint_sw;
--- 149,155 ----
  	return;
      }
  #ifdef SUNTOOL
!     if (!compose_frame || window_get(compose_frame, FRAME_CLOSED))
          wprint_sw = mfprint_sw;
      else
          wprint_sw = cprint_sw;
*** /tmp/,RCSt1024261	Fri Dec 22 09:56:06 1989
--- version.h	Fri Dec 22 09:49:24 1989
***************
*** 1,8 ****
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"12/18/89"
  #define RELEASE		7
  #define REVISION	"0"
! #define PATCHLEVEL	2
  #define ORIGINAL_DATE	"12/10/89"
--- 1,8 ----
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"12/22/89"
  #define RELEASE		7
  #define REVISION	"0"
! #define PATCHLEVEL	3
  #define ORIGINAL_DATE	"12/10/89"
*** /tmp/,RCSt1024377	Fri Dec 22 09:56:08 1989
--- doproc.c	Wed Dec 20 18:34:00 1989
***************
*** 454,460 ****
  Event *event;
  {
      int tmp = current_msg;
!     char buf[16];
  
      if (event && event_id(event) == MS_LEFT)
  	value = 0;
--- 454,460 ----
  Event *event;
  {
      int tmp = current_msg;
!     char buf[256];
  
      if (event && event_id(event) == MS_LEFT)
  	value = 0;
*** /tmp/,RCSt1024377	Fri Dec 22 09:56:14 1989
--- select.c	Fri Dec 22 09:22:20 1989
***************
*** 202,208 ****
--- 202,211 ----
  		current_msg = message;
  		(void) do_hdrs(0, DUBL_NULL, NULL);
  	    }
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
+ 	    /* SunOS 3.5 suffers from a shortage of file descriptors */
  	    turnon(glob_flags, NEW_FRAME);
+ #endif /* ALERT_ADDR */
  	    more_prompt = compose_hdr(message);
  	    display_msg(message, (u_long)0);
      }
-- 
Bart Schaefer     "Miserable miscreant!  Question MY integrity, will you?"
               "I have to see some *evidence* of it before I can question it."
                                                            -- Calvin & Hobbes
schaefer@cse.ogi.edu (used to be cse.ogc.edu)