Official Patch #5 for Mush 6.5

Barton E. Schaefer schaefer at ogccse.ogc.edu
Tue Jun 27 08:12:42 AEST 1989


Hmm ... Dan and I don't seem to be able to generate a "small" patch, do we.
I'll try to keep the summary short.  One quick note:  A longjmp botch at a
very strange time and a seg fault in curses mode were reported on an elxsi
BSD-type system.  We cannot reproduce either of these and have had no such
reports from anyone else.  If you experience odd problems like these, we
recommend that you (1) remove the call to longjmp() at line 123 of execute.c
(it is needed only for efficiency, not correctness), and (2) compile WITHOUT
using the optimizer (i.e. no "cc -O").

As usual, a complete copy of mush including this patch is available for
anonymous ftp from ucbvax.berkeley.edu, file pub/mush-6.5.tar.Z.

Mailrc:
    Minor corrections.
Mushrc:
    New file -- suggested /usr/lib/Mushrc init file.
README:
    Some new installation instructions.
README-6.5:
    Corrections to previous notes; summary of this patch added.
commands.c:
    Minor bugfixes to "?" command.
config.h:
    New definition ALT_DEF_RC and change of DEFAULT_RC (see README).
init.c:
    Code to use new DEFAULT_RC and ALT_DEF_RC combination.
lock.c:
    Don't print the "waiting to lock" message when input is redirected.
mail.c:
    Fixed "mail -E" and suntool Cc/Bcc/To setting from menus.
main.c:
    Get the mailfile from the new field of the mush_flags structure.
makefile.*:
    New "install" target, added Mushrc to HELP_FILES.
misc.c:
    Print error message when help file not found by help command.
mush.1:
    Some proofreading, and updates.
options.c:
    Use new field of struct mush_flags to return mailfile name.
options.h:
    New field "folder" in struct mush_flags for -f and -u options.
sample.mushrc:
    Took out some stuff that is now done in Mushrc.
version.h:
    New RELEASE_DATE and PATCHLEVEL.

Prereq: "6/12/89"
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:48 1989
--- version.h	Fri Jun 23 13:28:18 1989
***************
*** 1,8 ****
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"6/12/89"
  #define RELEASE		6
  #define REVISION	5
! #define PATCHLEVEL	4
  #define ORIGINAL_DATE	"4/17/89"
--- 1,8 ----
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"6/26/89"
  #define RELEASE		6
  #define REVISION	5
! #define PATCHLEVEL	5
  #define ORIGINAL_DATE	"4/17/89"
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:34 1989
--- Mailrc	Mon Jun 26 10:52:11 1989
***************
*** 1,5 ****
--- 1,10 ----
  # .mushrc to cause Mush to emulate UCB Mail
  # -- Bart Schaefer (schaefer at cse.ogc.edu)
+ #
+ # This file can be used as either the DEFAULT_RC or the ALT_DEF_RC (see
+ #  config.h) but such use is NOT recommended.  Instead, you should modify
+ #  one of those files to "source" this file.
+ #
  #----------------------------------------------------------------------------
  # Shortcomings:
  #  Mush does not support the "noisy phone line" flags of Mail
***************
*** 31,36 ****
--- 36,42 ----
  #
  cmd Reply replysender
  cmd R replysender
+ cmd alt alternates
  cmd chdir cd
  cmd chd cd
  cmd + next
***************
*** 49,51 ****
--- 55,65 ----
  cmd un undelete
  cmd unread 'flags \!* U'	# "unread" is undocumented in Mail
  cmd uns unset
+ cmd vi v
+ #
+ # You may want this file sourced, especially if you are not using the
+ #  supplied Mushrc file as your DEFAULT_RC.
+ #
+ # set ALT_DEF_RC = "/usr/lib/Mail.rc"
+ # source $ALT_DEF_RC
+ # unset ALT_DEF_RC
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:34 1989
--- Mushrc	Mon Jun 26 11:06:51 1989
***************
*** 0 ****
--- 1,134 ----
+ # Mushrc -- suggested /usr/lib/Mushrc init file for Mush
+ # Copyright (c) 1989 by Bart Schaefer and Dan Heller
+ #
+ # Set these variables as they are set in config.h
+ # (assumes that this file is DEFAULT_RC from config.h)
+ set \
+ 	MAILRC =	".mushrc" \
+ 	ALTERNATE_RC =	".mailrc" \
+ 	ALT_DEF_RC =	"/usr/lib/Mail.rc"
+ 
+ # Set up the display early to allow quick exit in headers-only mode.
+ # The hdrs_only flag is true if the command line was: "mush -H".
+ # The variable hdr_format is set to change the format of the header
+ # summaries that are displayed.
+ if hdrs_only
+     set hdr_format='%22a %M %-2N %5T  %.33s'
+     exit	# Quits reading this file
+ else
+     set hdr_format='%22a %M %-2N %5T (%3.5l li) %.25s'
+ endif
+ 
+ # Set the prompt to show current time, name of the current folder,
+ # current message number, and count of total messages.
+ set prompt="(%T) %f: #%m of %t> "
+ 
+ # Hitting <CR> should do nothing (helps make mush more shell-like).  If
+ # newline is not set, hitting <CR> prints the next message (like Mail).
+ # This variable could be set to any mush command.
+ set newline
+ 
+ # When reading messages, don't bother looking at lengthy, boring headers.
+ ignore message-id received via status
+ 
+ # Since mush has csh-like history, you might find it annoying to type
+ # things like "mail host\!host1\!host2\!user" from within the mush shell.
+ # Setting nonobang will prevent the "unknown event" and allow the !'s to
+ # be typed without having to be preceded by backslashes.
+ set nonobang
+ 
+ # By default, mush's history is set to the last command only.  Set it to
+ # remember the last 100 commands.
+ set history = 100
+ 
+ # If the variable "unix" is set, then any command that isn't a mush command
+ # will execute the command as if you typed it from the shell.  Note, such
+ # commands will not go through another shell -- this is it.  This may be
+ # considered confusing for new users, so it is commented out by default.
+ # set unix
+ 
+ # When you use the -i option to reply, or use the ~i tilde escape in a letter
+ # when in compose mode, the current message will be included in your text.
+ # Put a nice wrapper around those included messages.  Here, show the author's
+ # name and the subject of his letter, label the end, and add a trailing blank
+ # to separate each inclusion and make finding the end easier.
+ set pre_indent_str='On %M %N, %T, %.50n wrote:\n} Subject: %.65s'
+ set indent_str='} '	# actual message text is preceded by a "}"
+ set post_indent_str='}-- End of excerpt from %.50n\n'
+ 
+ # Label replies with a header showing the who, what, and when of the
+ # message being replied-to.
+ set in_reply_to='%f\n\t"%s" (%d)'
+ 
+ # Mail routing and address-fixing conveniences.  If auto_route is set, then
+ # replies to messages take a closer look at the addresses of the recipients.
+ # If any redundant paths are present, they are pruned.  Also, the path that
+ # precedes any hosts listed in the "known_hosts" list is truncated.  This is
+ # useful for uucp sites only, and is therefore commented out by default.
+ # set auto_route known_hosts="sun ucbcad well unicom"
+ 
+ # The curses mode allows the screen to be set up like a full screen editor.
+ # There are basic "curses commands" which are bound to keyboard key-sequences
+ # (usually one character).  The user can rebind these keys to suit his tastes.
+ # Note that the binding for R below removes the binding of reply-all.
+ #
+ set curses_help		# Unset this to remove help message in curses.
+ bind \n display		# Hit return to display the next message.
+ bind e macro "[line-mode]edit\n"	# Quick edit from curses.
+ bind P macro "[line-mode]Print\n"	# Show me all the headers.
+ 
+ # "cmd" is used to set command line aliases similar to the way "csh"
+ # does it.  The only difference is that "alias" is a reserved word in
+ # Mush and Mail, so cmd is used.
+ #
+ cmd dq 'd \!*; q'		# Delete a message list, then quit.
+ cmd unread 'flags \!* U O'	# Mark messages unread.
+ cmd : curses			# Colon now "toggles" curses mode.
+ 
+ # Read the alternate system init file in addition to this file
+ source $ALT_DEF_RC
+ unset ALT_DEF_RC
+ 
+ # Mush tries to read ~/.mushrc first, then it tries ~/.mailrc.  If .mushrc
+ # is found, .mailrc is normally not read.  Source the contents of .mailrc
+ # as well in case there are Mail aliases that are set there.
+ if -e $HOME/$MAILRC
+     if -e $HOME/$ALTERNATE_RC
+ 	source $HOME/$ALTERNATE_RC
+     endif
+ endif
+ unset ALTERNATE_RC
+ 
+ # The rest of this file demonstrates how sysadmins with novice users
+ # might want to set things up.
+ 
+ if -e $HOME/.mushexpert
+     set quiet
+     exit
+ endif
+ if ! -e $HOME/.mushuser
+     echo "I see you've never used the Mush program before."
+     echo "I'll set some special flags to help you out."
+     echo "After you've used Mush a few times, you can type the command:"
+     echo -p "\n${prompt}expert\n"
+     echo "and the flags will no longer be set unless you put them"
+     echo "in your $HOME/$MAILRC file."
+     echo ""
+     sh touch $HOME/.mushuser	# Use sh in case $unix is not set.
+     if $?quiet
+ 	unset quiet		# Show the help message on startup.
+     endif
+ endif
+ # At this point some helpful variables should be set.  See the list above,
+ # marked as "helpful for new users", for suggestions.
+ #
+ # Create the "expert" command mentioned in the message above.
+ cmd expert 'sh touch $HOME/.mushexpert'
+ 
+ # These variables are helpful for new users:
+ #	ask		-- always prompt for Subject: of mail
+ #	ignoreeof	-- ignore end-of-file from keyboard
+ #	verify		-- query that all is well before sending mail
+ #	warning		-- report miscellaneous possible problems
+ set ask verify warning
+ set ignoreeof="echo 'Use "'"'quit'"'" to quit.'"
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:36 1989
--- README	Mon Jun 26 14:28:06 1989
***************
*** 301,328 ****
      know, mush will use another function although not as optimum as select().
  
  ---------------
! The default Mailrc startup file:
!     A default mailrc should be installed for new users.  UCB mail's default
!     Mailrc works but no mailrc works also. The location of the default
!     file should be defined in config.h.  To have no default mailrc, set the
!     default to /dev/null.
!     For sun systems, the default .mailrc (/usr/lib/Mailrc) does not work
!     very well because sun's Mail is not standard /usr/ucb/Mail.
!     For this reason, sun has not changed the default mailrc file and still
!     resides in /usr/lib/Mail.rc (note this has the "." whereas the other file
      does not).  The default config.h-dist reflects this.
  
!     There is a supplied Mushrc file with mush, but this is only intended to
      be used as an example of how to make mush look like ucbMail.  This is a
!     _reduction_ in functionality and its usage is not encouraged.
  
      There is a Gnurc file which can aid in making mush's curses mode appear
      to interact similar to gnu-emacs.
  
  ---------------
  Help files:
      The help files should be placed somewhere which is readable and accessible
!     by all. Failing to do so removes virtually the entire help facility's
      ability to help anyone.  There is a help file (cmd_help) for command help
      (e.g. "command -?"), and the tool_help is for the graphics mode (Sun
      workstations only).  You should define where you want these files in
--- 301,349 ----
      know, mush will use another function although not as optimum as select().
  
  ---------------
! The default Mushrc startup file:
!     A default mushrc should be installed, containing local configuration
!     information (aliases or variable settings).  This can also provide
!     first-time users with a more friendly interface.  UCB mail's default
!     Mail.rc works, but no default file works also.  The location of the
!     default file should be defined in config.h.  To have no default Mushrc,
!     set the default to /dev/null.
! 
!     The Mushrc file supplied with the mush distribution is heavily commented
!     and uses several of mush's features in setting up the interface.  If you
!     use this file, you should modify it so settings of the variables MAILRC,
!     ALTERNATE_RC, and ALT_DEF_RC correspond to the definitions in your
!     config.h file.  The Mushrc is designed to source the ALT_DEF_RC, which
!     is usually equivalent to the UCB mail Mail.rc.  This eases the transition
!     to mush for UCB sites, and allows aliases and settings that should apply
!     to both mush and mail to reside in a single file.  UUCP sites may also
!     want to uncomment the line which sets the auto_route and known_hosts
!     variables; be sure to modify known_hosts to be an accurate list of your
!     UUCP mail neighbors.
! 
!     For sun systems, the sun Mail Mailrc (/usr/lib/Mailrc) does not work
!     very well because sun's Mail is not standard /usr/ucb/Mail.  For this
!     reason, sun has not changed the default Mail.rc which still resides
!     in /usr/lib/Mail.rc (note this has the "." whereas the other file
      does not).  The default config.h-dist reflects this.
  
!     There is a supplied Mailrc file with mush, but this is only intended to
      be used as an example of how to make mush look like ucbMail.  This is a
!     _reduction_ in functionality and its usage is not encouraged.  It is
!     provided for those who wish to "invisibly" replace UCB mail with mush.
  
      There is a Gnurc file which can aid in making mush's curses mode appear
      to interact similar to gnu-emacs.
  
+     The files sample.mushrc and advanced.mushrc are intended as samples of
+     individual users' ~/.mushrc files.  There is some overlap from Mushrc
+     in sample.mushrc; in particular, if you use Mushrc as the default file,
+     the sample.mushrc need not source ~/.mailrc.
+ 
  ---------------
  Help files:
      The help files should be placed somewhere which is readable and accessible
!     by all.  Failing to do so removes virtually the entire help facility's
      ability to help anyone.  There is a help file (cmd_help) for command help
      (e.g. "command -?"), and the tool_help is for the graphics mode (Sun
      workstations only).  You should define where you want these files in
***************
*** 330,336 ****
  
  ---------------
  
! You should now be able to run make.
  
  ---------------
  Maintenance:
--- 351,360 ----
  
  ---------------
  
! You should now be able to run make.  A target "install" is provided to put
! the mush binary and the help and init files in their proper places; be sure
! to correct the destination directories in the Makefile you have selected,
! and to doublecheck file path names in the init files.
  
  ---------------
  Maintenance:
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:41 1989
--- README-6.5	Mon Jun 26 10:53:58 1989
***************
*** 151,157 ****
  Bugfixes only, except for change to -DUUCP (see README).
  
  ----------
! Changes in the 6-09-89 patch:
  
  Numerous bugfixes: address comparisons, toolmode Respond item, MMDF file
  locking, miscellaneous malloc calls, "e" and "v" commands, curses screen
--- 151,157 ----
  Bugfixes only, except for change to -DUUCP (see README).
  
  ----------
! Changes in the 6-12-89 patch:
  
  Numerous bugfixes: address comparisons, toolmode Respond item, MMDF file
  locking, miscellaneous malloc calls, "e" and "v" commands, curses screen
***************
*** 185,187 ****
--- 185,213 ----
  Status flags for "forwarded" and "printed" are now set on the appropriate
  messages.  The "printed" flag is set automatically only on messages printed
  with the mush "lpr" command.  The "flags" command can set either flag.
+ 
+ The patch level now appears in the version string (see new file version.h).
+ 
+ ----------
+ Changes in the 6-26-89 patch:
+ 
+ Mush now reads its own default initialization file in preference to the old
+ UCB mail default file.  The old default has moved to ALT_DEF_RC, which is
+ normally read only if the DEFAULT_RC is not found.  See config.h and README.
+ A suggested new DEFAULT_RC is provided (see Mushrc); this file sources the
+ ALT_DEF_RC for compatibility with the old behavior.
+ 
+ Some minor corrections have been made to the UCB emulation Mailrc.  Also,
+ it was noted that mush does not behave the same way that UBC mail does
+ when redirecting input; in particular, tilde-commands in redirected
+ message files are not interpreted.  This is now mentioned in the man page.
+ 
+ Assorted bugfixes:  The "await" command has become visible in the "?"
+ listing, and a null pointer dereference in "?" has been corrected; the
+ -E flag to "mail" now functions correctly; setting header fields from the
+ menu in suntools works again; missing help files produce an error message;
+ the man page has been updated.
+ 
+ Installation directives have been added to the makefiles.  Look over the
+ various initialization and help files and fix any file path names before
+ using "make install".  See README.
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:48 1989
--- commands.c	Tue Jun 20 10:06:13 1989
***************
*** 46,52 ****
      { "lpr",      lpr	      },  { "alternates",  alts       },
      { "edit",	  edit_msg    },  { "flags",	   msg_flags  },
      { "pipe",     pipe_msg    },  { "eval",	   eval_cmd   },
!     { "undigest", do_undigest    },
      { NULL, quit }
  };
  
--- 46,52 ----
      { "lpr",      lpr	      },  { "alternates",  alts       },
      { "edit",	  edit_msg    },  { "flags",	   msg_flags  },
      { "pipe",     pipe_msg    },  { "eval",	   eval_cmd   },
!     { "undigest", do_undigest },  { "await",	   await      },
      { NULL, quit }
  };
  
***************
*** 73,79 ****
  
  struct cmd hidden_cmds[] = {
      { "debug", toggle_debug }, { "open", 	nopenfiles },
!     { "stty",	my_stty     }, { "await",	await      },
      { "setenv",	Setenv      }, { "unsetenv", 	Unsetenv   },
      { "printenv", Printenv  }, { "Pipe",	pipe_msg   },
      { NULL, quit }
--- 73,79 ----
  
  struct cmd hidden_cmds[] = {
      { "debug", toggle_debug }, { "open", 	nopenfiles },
!     { "stty",	my_stty     },
      { "setenv",	Setenv      }, { "unsetenv", 	Unsetenv   },
      { "printenv", Printenv  }, { "Pipe",	pipe_msg   },
      { NULL, quit }
***************
*** 751,757 ****
  		    free_vec(Cmds);
  		    return -1;
  		}
! 	    if (x%5*N+n-1 < sizeof cmds / sizeof (struct cmd))
  		p += strlen(sprintf(p, "%-14.14s ", cmds[x%5*N+n-1].command));
  	}
  	Cmds[n++] = savestr("Type: `command -?' for help with most commands.");
--- 751,757 ----
  		    free_vec(Cmds);
  		    return -1;
  		}
! 	    if (x%5*N+n < sizeof cmds / sizeof (struct cmd))
  		p += strlen(sprintf(p, "%-14.14s ", cmds[x%5*N+n-1].command));
  	}
  	Cmds[n++] = savestr("Type: `command -?' for help with most commands.");
***************
*** 789,796 ****
  {
      char *newstr;
  
!     if (i < 2 || i > 3 || !strcmp(argv[1], "-?"))
  	return help(0, "setenv", cmd_help);
  
      if (i == 3) {
  	if (newstr = malloc(strlen(argv[1]) + strlen(argv[2]) + 2))
--- 789,798 ----
  {
      char *newstr;
  
!     if (i > 3 || !strcmp(argv[1], "-?"))
  	return help(0, "setenv", cmd_help);
+     else if (i < 2)
+ 	return Printenv(i, argv);
  
      if (i == 3) {
  	if (newstr = malloc(strlen(argv[1]) + strlen(argv[2]) + 2))
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:50 1989
--- config.h-dist	Thu Jun 22 21:00:45 1989
***************
*** 2,8 ****
  
  #define MAILRC		".mushrc"
  #define ALTERNATE_RC	".mailrc"
! #define DEFAULT_RC	"/usr/lib/Mail.rc"
  #define COMMAND_HELP	"/usr/lib/cmd_help"
  #ifdef SUNTOOL
  #    define TOOL_HELP	"/usr/lib/tool_help"
--- 2,9 ----
  
  #define MAILRC		".mushrc"
  #define ALTERNATE_RC	".mailrc"
! #define DEFAULT_RC	"/usr/lib/Mushrc"
! #define ALT_DEF_RC	"/usr/lib/Mail.rc"
  #define COMMAND_HELP	"/usr/lib/cmd_help"
  #ifdef SUNTOOL
  #    define TOOL_HELP	"/usr/lib/tool_help"
*** /tmp/,RCSt1015447	Mon Jun 26 14:34:59 1989
--- init.c	Fri Jun 23 12:15:49 1989
***************
*** 277,284 ****
  
      argc = 0; /* don't ignore ENOENT */
      p = getpath(file, &argc);
      if (argc) {
! 	if (strcmp(file, DEFAULT_RC))
  	    if (argc == -1)
  		print("%s: %s\n", file, p);
  	    else
--- 277,291 ----
  
      argc = 0; /* don't ignore ENOENT */
      p = getpath(file, &argc);
+     /* Try the ALT_DEF_RC if DEFAULT_RC fails */
+     if (argc && !strcmp(file, DEFAULT_RC)) {
+ 	argc = 0; /* don't ignore ENOENT */
+ 	(void) strcpy(file, ALT_DEF_RC);
+ 	p = getpath(file, &argc);
+     }
      if (argc) {
! 	/* Don't print error messages for missing default files */
! 	if (strcmp(file, ALT_DEF_RC))
  	    if (argc == -1)
  		print("%s: %s\n", file, p);
  	    else
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:00 1989
--- lock.c	Wed Jun 14 11:31:51 1989
***************
*** 106,117 ****
  	SIGRET (*oldint)(), (*oldquit)();
  	on_intr();
  	while (isoff(glob_flags, WAS_INTR) && flock(fd, LOCK_EX | LOCK_NB)) {
! 	    if (errno == EWOULDBLOCK)
! 		if (!cnt++)
! 		    print("\nwaiting to lock");
! 		else
! 		    print(".");
! 	    else {
  		error("Unable to lock \"%s\"", filename);
  		off_intr();
  		return -1;
--- 106,118 ----
  	SIGRET (*oldint)(), (*oldquit)();
  	on_intr();
  	while (isoff(glob_flags, WAS_INTR) && flock(fd, LOCK_EX | LOCK_NB)) {
! 	    if (errno == EWOULDBLOCK) {
! 		if (isoff(glob_flags, REDIRECT))
! 		    if (!cnt++)
! 			print("\nwaiting to lock");
! 		    else
! 			print(".");
! 	    } else {
  		error("Unable to lock \"%s\"", filename);
  		off_intr();
  		return -1;
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:04 1989
--- mail.c	Fri Jun 23 13:28:51 1989
***************
*** 431,437 ****
  	(!istool || !get_hdr_field) &&
  #endif /* SUNTOOL */
  	(isoff(flags, FORWARD) || ison(flags, EDIT)) &&
! 	    do_set(set_options, "edit_hdrs")) {
  	turnon(flags, EDIT_HDRS);
  	if (add_headers(NULL, &ed_fp, 1, flags) == (long) -1)
  	    return -1;
--- 431,437 ----
  	(!istool || !get_hdr_field) &&
  #endif /* SUNTOOL */
  	(isoff(flags, FORWARD) || ison(flags, EDIT)) &&
! 	    (ison(flags, EDIT_HDRS) || do_set(set_options, "edit_hdrs"))) {
  	turnon(flags, EDIT_HDRS);
  	if (add_headers(NULL, &ed_fp, 1, flags) == (long) -1)
  	    return -1;
***************
*** 789,795 ****
  	    }
  #ifdef SUNTOOL
  	    if (!*p && istool) {
! 		turnon(get_hdr_field, CC_FIELD);
  		(void) set_header(Prompt, h, 1);
  		panel_set(send_item, PANEL_SHOW_ITEM, FALSE, 0);
  		panel_set(edit_item, PANEL_SHOW_ITEM, FALSE, 0);
--- 789,797 ----
  	    }
  #ifdef SUNTOOL
  	    if (!*p && istool) {
! 		turnon(get_hdr_field,
! 			line[1] == 't'? TO_FIELD :
! 			line[1] == 'b'? BC_FIELD : CC_FIELD);
  		(void) set_header(Prompt, h, 1);
  		panel_set(send_item, PANEL_SHOW_ITEM, FALSE, 0);
  		panel_set(edit_item, PANEL_SHOW_ITEM, FALSE, 0);
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:08 1989
--- main.c	Sat Jun 24 19:59:22 1989
***************
*** 111,116 ****
--- 111,118 ----
  	(void) cmd_line(sprintf(buf, "source %s", DEFAULT_RC), msg_list);
  	(void) source(0, DUBL_NULL);
      }
+     if (Flags.folder && *Flags.folder)
+ 	mailfile = Flags.folder;
  
      set_cwd();  /* call _after_ sourcing files */
  
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:09 1989
--- makefile.bsd	Mon Jun 26 10:54:02 1989
***************
*** 13,24 ****
        lock.o macros.o options.o addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  
  MAKES= makefile.bsd makefile.xenix makefile.sys.v
  
  CFLAGS= -O -DCURSES -DBSD
! LDFLAGS= -s
  LINTFLAGS= -bxah -Dlint -DCURSES -DBSD
  LIBES= -lcurses -ltermlib
  
--- 13,25 ----
        lock.o macros.o options.o addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 cmd_help sample.mushrc advanced.mushrc \
! 	Mushrc Mailrc Gnurc
  
  MAKES= makefile.bsd makefile.xenix makefile.sys.v
  
  CFLAGS= -O -DCURSES -DBSD
! LDFLAGS=
  LINTFLAGS= -bxah -Dlint -DCURSES -DBSD
  LIBES= -lcurses -ltermlib
  
***************
*** 43,45 ****
--- 44,63 ----
  
  clean:
  	rm -f *.o core mush
+ 
+ BINDIR= /usr/local/bin
+ LIBDIR= /usr/local/lib
+ MRCDIR= /usr/lib
+ MANDIR= /usr/local/man/man1
+ MANEXT= 1
+ 
+ install: mush
+ 	mv mush $(BINDIR)
+ 	strip $(BINDIR)/mush
+ 	chmod 0755 $(BINDIR)/mush
+ 	cp mush.1 $(MANDIR)/mush.$(MANEXT)
+ 	chmod 0644 $(MANDIR)/mush.$(MANEXT)
+ 	cp cmd_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/cmd_help
+ 	cp Mushrc $(MRCDIR)/Mushrc
+ 	chmod 0644 $(MRCDIR)/Mushrc
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:09 1989
--- makefile.hpux	Mon Jun 26 10:54:06 1989
***************
*** 16,26 ****
  	addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  CFLAGS= 	-O -DSYSV -DHPUX -DCURSES -DREGCMP -DUSG -DSIGRET=void -DSELECT
! LDFLAGS= 	-s
  LIBS= 		-lcurses -lPW -lmalloc
  PROG=		mush
  
--- 16,27 ----
  	addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 cmd_help sample.mushrc advanced.mushrc \
! 	Mushrc Mailrc Gnurc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  CFLAGS= 	-O -DSYSV -DHPUX -DCURSES -DREGCMP -DUSG -DSIGRET=void -DSELECT
! LDFLAGS=
  LIBS= 		-lcurses -lPW -lmalloc
  PROG=		mush
  
***************
*** 30,32 ****
--- 31,50 ----
  
  $(OBJS1): $(HDRS1) $(HDRS2)
  $(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
+ 
+ BINDIR= /usr/local/bin
+ LIBDIR= /usr/local/lib
+ MRCDIR= /usr/lib
+ MANDIR= /usr/local/man/man1
+ MANEXT= 1
+ 
+ install: mush
+ 	cp mush $(BINDIR)
+ 	strip $(BINDIR)/mush
+ 	chmod 0755 $(BINDIR)/mush
+ 	cp mush.1 $(MANDIR)/mush.$(MANEXT)
+ 	chmod 0644 $(MANDIR)/mush.$(MANEXT)
+ 	cp cmd_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/cmd_help
+ 	cp Mushrc $(MRCDIR)/Mushrc
+ 	chmod 0644 $(MRCDIR)/Mushrc
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:10 1989
--- makefile.sys.v	Mon Jun 26 10:54:13 1989
***************
*** 17,23 ****
  	addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  # Sun OS systems who wish to compile with sys-v options:
--- 17,24 ----
  	addrs.o malloc.o
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 cmd_help sample.mushrc advanced.mushrc \
! 	Mushrc Mailrc Gnurc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  # Sun OS systems who wish to compile with sys-v options:
***************
*** 25,31 ****
  # CFLAGS= 	-O -DSYSV -DCURSES -DUSG
  # LIBS= -L/usr/5lib -lcurses
  CFLAGS= 	-O -DSYSV -DCURSES -DREGCMP -DUSG -DSIGRET=void
! LDFLAGS= 	-s
  LIBS= 		-lcurses -lPW
  PROG=		mush
  
--- 26,32 ----
  # CFLAGS= 	-O -DSYSV -DCURSES -DUSG
  # LIBS= -L/usr/5lib -lcurses
  CFLAGS= 	-O -DSYSV -DCURSES -DREGCMP -DUSG -DSIGRET=void
! LDFLAGS=
  LIBS= 		-lcurses -lPW
  PROG=		mush
  
***************
*** 35,37 ****
--- 36,55 ----
  
  $(OBJS1): $(HDRS1) $(HDRS2)
  $(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
+ 
+ BINDIR= /usr/local/bin
+ LIBDIR= /usr/local/lib
+ MRCDIR= /usr/lib
+ MANDIR= /usr/local/man/man1
+ MANEXT= 1
+ 
+ install: mush
+ 	cp mush $(BINDIR)
+ 	strip $(BINDIR)/mush
+ 	chmod 0755 $(BINDIR)/mush
+ 	cp mush.1 $(MANDIR)/mush.$(MANEXT)
+ 	chmod 0644 $(MANDIR)/mush.$(MANEXT)
+ 	cp cmd_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/cmd_help
+ 	cp Mushrc $(MRCDIR)/Mushrc
+ 	chmod 0644 $(MRCDIR)/Mushrc
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:11 1989
--- makefile.xenix	Mon Jun 26 10:54:17 1989
***************
*** 21,27 ****
        folders.o dates.o loop.o viewopts.o bind.o curses.o curs_io.o \
        lock.o macros.o options.o addrs.o malloc.o
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  # Memory model.  Use -M3e for 80386 machines.
--- 21,28 ----
        folders.o dates.o loop.o viewopts.o bind.o curses.o curs_io.o \
        lock.o macros.o options.o addrs.o malloc.o
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
! 	README-6.5 mush.1 cmd_help sample.mushrc advanced.mushrc \
! 	Mushrc Mailrc Gnurc
  MAKES= makefile.sys.v makefile.xenix makefile.bsd
  
  # Memory model.  Use -M3e for 80386 machines.
***************
*** 68,70 ****
--- 69,88 ----
  
  clean:
  	rm -f *.o core mush
+ 
+ BINDIR= /usr/local/bin
+ LIBDIR= /usr/local/lib
+ MRCDIR= /usr/lib
+ MANDIR= /usr/local/man/man1
+ MANEXT= 1
+ 
+ install: mush
+ 	cp mush $(BINDIR)
+ 	strip $(BINDIR)/mush
+ 	chmod 0755 $(BINDIR)/mush
+ 	cp mush.1 $(MANDIR)/mush.$(MANEXT)
+ 	chmod 0644 $(MANDIR)/mush.$(MANEXT)
+ 	cp cmd_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/cmd_help
+ 	cp Mushrc $(MRCDIR)/Mushrc
+ 	chmod 0644 $(MRCDIR)/Mushrc
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:13 1989
--- misc.c	Fri Jun 23 12:52:55 1989
***************
*** 90,97 ****
  	return 0;
      }
  
!     if (!(fp = fopen(file, "r")))
  	return -1;
      /* look for %str% in helpfile */
      (void) sprintf(help_str, "%%%s%%\n", str);
  
--- 90,99 ----
  	return 0;
      }
  
!     if (!(fp = fopen(file, "r"))) {
! 	print("Cannot open help file \"%s\".\n", file);
  	return -1;
+     }
      /* look for %str% in helpfile */
      (void) sprintf(help_str, "%%%s%%\n", str);
  
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:18 1989
--- mush.1	Mon Jun 26 10:47:30 1989
***************
*** 8,14 ****
  .if n .ds - --
  .if t .ds - \(em
  .nh
! .TH MUSH 1 "May 12, 1989" "Version 6.5"
  .UC 4
  .SH NAME
  The Mail User's Shell \- Shell for electronic mail.
--- 8,14 ----
  .if n .ds - --
  .if t .ds - \(em
  .nh
! .TH MUSH 1 "June 26, 1989" "Version 6.5.5"
  .UC 4
  .SH NAME
  The Mail User's Shell \- Shell for electronic mail.
***************
*** 804,813 ****
  .PP
  .IR "Sending mail" .
  .PP
! You can send mail using the
  .B mail
! command or by responding to other mail.
! In either case, when you are sending mail, you are in a mode where everything
  you type is added to the contents of the message.
  When you are done typing your message, you can type `^D'
  (control-D) to signify the end of the message.
--- 804,817 ----
  .PP
  .IR "Sending mail" .
  .PP
! You can send mail by listing addresses on the command line when
! .I Mush
! is started, by using the
  .B mail
! command from within
! .IR Mush ,
! or by responding to other mail.
! In any case, when you are sending mail, you are in a mode where everything
  you type is added to the contents of the message.
  When you are done typing your message, you can type `^D'
  (control-D) to signify the end of the message.
***************
*** 968,973 ****
--- 972,980 ----
  escape character.
  When sending mail, the above tilde escapes are available in
  all three user interfaces.
+ However, \fItilde escapes are NOT interpreted when mush is started with
+ redirected input\fR.
+ If tilde-interpretation is desired, use the \-i option when starting mush.
  .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.
***************
*** 1214,1220 ****
  command in your initialization file is a no-no, so you can alias your
  login shell mail command to include the -C option.
  If you use the Bourne Shell, you're going to have to type it out all the time.
! Mush will attempt to know not to run a shell if you're just sending mail to
  someone, so the
  .I csh
  command line sequences:
--- 1221,1228 ----
  command in your initialization file is a no-no, so you can alias your
  login shell mail command to include the -C option.
  If you use the Bourne Shell, you're going to have to type it out all the time.
! .I Mush
! will attempt to know not to run a shell if you're just sending mail to
  someone, so the
  .I csh
  command line sequences:
***************
*** 1639,1645 ****
  will not send a copy of the message to your login name at any of the
  hosts listed on the
  .B alternates
! list.  If the special symbox \*Q*\*U is used, then your login name is
  matched against all pathnames and local addresses.
  .sp
  If you have another login name on the local or remote machine, then
--- 1647,1653 ----
  will not send a copy of the message to your login name at any of the
  hosts listed on the
  .B alternates
! list.  If the special symbol \*Q*\*U is used, then your login name is
  matched against all pathnames and local addresses.
  .sp
  If you have another login name on the local or remote machine, then
***************
*** 2398,2404 ****
  \-r msg_list	search only the listed messages.
  \-s	search for pattern in \*QSubject\*U field only.
  \-t	search for pattern in \*QTo\*U field only.
! \-x	select all messages \fIexcept\fP those specified.
  .in -2
  .fi
  .sp
--- 2406,2412 ----
  \-r msg_list	search only the listed messages.
  \-s	search for pattern in \*QSubject\*U field only.
  \-t	search for pattern in \*QTo\*U field only.
! \-x	select messages that do \fInot\fR match the pattern.
  .in -2
  .fi
  .sp
***************
*** 2544,2550 ****
  .IR UNIX (TM)
  commands can appear anywhere
  .I except as the first command
! in a mush pipeline without explicitly using
  .BR pipe .
  However, it is still necessary to specify
  .B Pipe
--- 2552,2560 ----
  .IR UNIX (TM)
  commands can appear anywhere
  .I except as the first command
! in a 
! .I Mush
! pipeline without explicitly using
  .BR pipe .
  However, it is still necessary to specify
  .B Pipe
***************
*** 2807,2813 ****
  .B home
  variable descriptions for more information.
  .TP
! .BR sort " [\-] [a | d | s | S | R]"
  This command
  will sort messages according to author, date, status or subject
  (with or without considering the "Re: ", in replied messages).
--- 2817,2823 ----
  .B home
  variable descriptions for more information.
  .TP
! .BR sort " [\-] [a | d | l | R | s | S]"
  This command
  will sort messages according to author, date, status or subject
  (with or without considering the "Re: ", in replied messages).
***************
*** 2930,2937 ****
  .BR update " -N"
  Updates your current folder writing back changes just as if you
  .BR quit.
! The \-N option prevents the headers from being listed once the
! folder has been read back in once it has been updated.
  .sp
  See the
  .BR folder
--- 2940,2947 ----
  .BR update " -N"
  Updates your current folder writing back changes just as if you
  .BR quit.
! The \-N option prevents the headers from being listed when the
! folder is read back in after it has been updated.
  .sp
  See the
  .BR folder
***************
*** 3391,3397 ****
  However, there are some restrictions.
  .sp
  There must be a To: header.
! Without this, mush will not deliver the letter.
  Instead, the editor must be reentered and a To: header with
  a valid recipient must be inserted.
  A valid Cc: header does not remove this restriction.
--- 3401,3409 ----
  However, there are some restrictions.
  .sp
  There must be a To: header.
! Without this, 
! .I Mush
! will not deliver the letter.
  Instead, the editor must be reentered and a To: header with
  a valid recipient must be inserted.
  A valid Cc: header does not remove this restriction.
***************
*** 3701,3708 ****
  .TP
  .B mbox
  (String)
! Set to the pathname of a file you'd like mush to use as the default
! holder for read mail.
  The default is ~/mbox.
  .TP
  .B metoo
--- 3713,3721 ----
  .TP
  .B mbox
  (String)
! Set to the pathname of a file you'd like 
! .I Mush
! to use as the default folder for read mail.
  The default is ~/mbox.
  .TP
  .B metoo
***************
*** 3977,3988 ****
  set reply_to_hdr = "sender reply-to return-path from_"
  .fi
  .sp
! This example shows that mush will search for (in order), the
! headers listed in the reply_to_hdr variable.  If one header isn't
! found, then mush looks for the next in the list.  If none of the
! headers in the list are found, the default headers (mentioned
! above) are searched.  The last header listed in the example is
! the special "From " header.
  Also see the
  .B reply
  command.
--- 3990,4004 ----
  set reply_to_hdr = "sender reply-to return-path from_"
  .fi
  .sp
! This example shows that 
! .I Mush
! will search for (in order), the headers listed in the reply_to_hdr variable.
! If one header isn't found, then
! .I Mush
! looks for the next in the list.
! If none of the headers in the list are found, the default headers (mentioned
! above) are searched.
! The last header listed in the example is the special \*QFrom \*U header.
  Also see the
  .B reply
  command.
***************
*** 4043,4049 ****
  .B sort
  command.
  This variable is used for the initialization file to presort
! mail in the system mailbox upon entering mush.
  See the COMMANDS section for more information.
  .TP
  .B squeeze
--- 4059,4066 ----
  .B sort
  command.
  This variable is used for the initialization file to presort
! mail in the system mailbox upon entering
! .IR Mush .
  See the COMMANDS section for more information.
  .TP
  .B squeeze
***************
*** 4123,4129 ****
  .I UNIX
  commands with the
  .I Mush
! pipe mechanism.  You can, however, pipe mush commands to a final UNIX
  command (see the \fBpipe\fR command for more information).
  UNIX commands should be simple commands without pipes or metacharacters.
  .sp
--- 4140,4148 ----
  .I UNIX
  commands with the
  .I Mush
! pipe mechanism.  You can, however, pipe
! .I Mush
! commands to a final UNIX
  command (see the \fBpipe\fR command for more information).
  UNIX commands should be simple commands without pipes or metacharacters.
  .sp
***************
*** 4215,4221 ****
  Line wrapping occurs only at whitespace (spaces or tabs).
  Lines containing no whitespace to the left of the specified column
  will not be wrapped.
! If mush was started with the \-e (echo mode) option, or is in tool mode,
  line wrapping cannot be done due to I/O incompatibilities.
  .SH MACROS
  Macros are available in several different modes in
--- 4234,4240 ----
  Line wrapping occurs only at whitespace (spaces or tabs).
  Lines containing no whitespace to the left of the specified column
  will not be wrapped.
! 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.
  .SH MACROS
  Macros are available in several different modes in
***************
*** 4243,4250 ****
  mode, nor when composing messages from the tool mode; see, however, the
  .B fkey
  command.
! Line and composition mode macros are also nonfunctional when mush is
! started with the \-e (echo) option.
  .PP
  In general, macros consist of two parts:  a
  .I "key sequence"
--- 4262,4270 ----
  mode, nor when composing messages from the tool mode; see, however, the
  .B fkey
  command.
! Line and composition mode macros are also nonfunctional when
! .I Mush
! is started with the \-e (echo) option.
  .PP
  In general, macros consist of two parts:  a
  .I "key sequence"
***************
*** 4332,4338 ****
  Note that, if you have a tty literal-next character,
  then when typing you will need to type
  .I two
! of them in order to send one to mush; this is because the tty
  driver consumes the first one.
  It is not necessary to use two literal-nexts in macro expansions
  unless you wish to cause the second literal-next to be literal.
--- 4352,4358 ----
  Note that, if you have a tty literal-next character,
  then when typing you will need to type
  .I two
! of them in order to send one to \fIMush\fR; this is because the tty
  driver consumes the first one.
  It is not necessary to use two literal-nexts in macro expansions
  unless you wish to cause the second literal-next to be literal.
***************
*** 4445,4451 ****
  bind @ macro [sort]d[last-msg][lpr]
  .sp
  Such references to curses functions may be made only in curses mode
! macros, and are effective only when mush is actually in curses mode.
  That may sound strange, but the most common use of curses macros is
  to quickly perform functions that require an escape to the line mode.
  For example, although there is a variation of the curses mode
--- 4465,4471 ----
  bind @ macro [sort]d[last-msg][lpr]
  .sp
  Such references to curses functions may be made only in curses mode
! macros, and are effective only when \fIMush\fR is actually in curses mode.
  That may sound strange, but the most common use of curses macros is
  to quickly perform functions that require an escape to the line mode.
  For example, although there is a variation of the curses mode
***************
*** 4637,4643 ****
  macro facility is very powerful.
  Be very careful not to accidentally expand recursive macros,
  especially when using macros that change modes.
! When testing new macros, it is a good idea to start mush in
  .I read-only
  mode (the \-r command line flag) to be sure that messages are
  not lost or altered.
--- 4657,4665 ----
  macro facility is very powerful.
  Be very careful not to accidentally expand recursive macros,
  especially when using macros that change modes.
! When testing new macros, it is a good idea to start
! .I Mush
! in
  .I read-only
  mode (the \-r command line flag) to be sure that messages are
  not lost or altered.
***************
*** 4761,4768 ****
  .in -2
  .sp
  Because there is no indication of comments (parenthesis, angle bracket,
! or quotes), it is assumed that these are separate addresses and mush will
! insert commas between these addresses accordingly.
  It is for this reason that the user is encouraged to explicitly insert
  commas between all mail addresses and not depend on the automation of comma
  insertion to correctly separate addresses from one another.
--- 4783,4791 ----
  .in -2
  .sp
  Because there is no indication of comments (parenthesis, angle bracket,
! or quotes), it is assumed that these are separate addresses and
! .I Mush
! will insert commas between these addresses accordingly.
  It is for this reason that the user is encouraged to explicitly insert
  commas between all mail addresses and not depend on the automation of comma
  insertion to correctly separate addresses from one another.
***************
*** 4864,4870 ****
  However, one unavoidable problem is the reverse video mode.
  Depending on your terminal,
  the termcap entry for it, and the version of curses you are running,
! the reverse video may makes things worse than desired.
  In such situations, the user should set the variable
  .B no_reverse
  to not get reverse video.
--- 4887,4893 ----
  However, one unavoidable problem is the reverse video mode.
  Depending on your terminal,
  the termcap entry for it, and the version of curses you are running,
! the reverse video may make things worse than desired.
  In such situations, the user should set the variable
  .B no_reverse
  to not get reverse video.
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:40 1989
--- options.c	Sat Jun 24 20:05:52 1989
***************
*** 158,164 ****
  
      bzero(flags, sizeof (struct mush_flags));
      flags->source_rc = TRUE;
!     mailfile = "";
  
      for (++(*argvp); **argvp && ***argvp == '-'; (*argvp)++) {
  	int look_again;
--- 158,164 ----
  
      bzero(flags, sizeof (struct mush_flags));
      flags->source_rc = TRUE;
!     flags->folder = "";
  
      for (++(*argvp); **argvp && ***argvp == '-'; (*argvp)++) {
  	int look_again;
***************
*** 208,214 ****
  		/* force interactive even if !isatty(0) */
  		turnoff(glob_flags, REDIRECT);
  	    when 'u': /* specify a user's mailbox */
! 		if (*mailfile)
  		    puts("You can't specify more than one mailbox"), exit(1);
  #ifdef HOMEMAIL
  		{
--- 208,214 ----
  		/* force interactive even if !isatty(0) */
  		turnoff(glob_flags, REDIRECT);
  	    when 'u': /* specify a user's mailbox */
! 		if (*(flags->folder))
  		    puts("You can't specify more than one mailbox"), exit(1);
  #ifdef HOMEMAIL
  		{
***************
*** 217,223 ****
  		    (void) sprintf(buf, "%%%s",
  				(*argvp)[1] ? (*argvp)[1] : "root");
  		    if ((p = getpath(buf, &isdir)) && !isdir)
! 			strdup(mailfile, p);
  		    else if (isdir < 0)
  			puts(p), exit(1);
  		    else if (isdir)
--- 217,223 ----
  		    (void) sprintf(buf, "%%%s",
  				(*argvp)[1] ? (*argvp)[1] : "root");
  		    if ((p = getpath(buf, &isdir)) && !isdir)
! 			strdup(flags->folder, p);
  		    else if (isdir < 0)
  			puts(p), exit(1);
  		    else if (isdir)
***************
*** 224,230 ****
  			printf("\"%s\" is a directory\n", p), exit(1);
  		}
  #else /* HOMEMAIL */
! 		strdup(mailfile, sprintf(buf, "%s/%s",
  			       MAILDIR, ((*argvp)[1])? (*argvp)[1] : "root"));
  #endif /* HOMEMAIL */
  		if ((*argvp)[1])
--- 224,230 ----
  			printf("\"%s\" is a directory\n", p), exit(1);
  		}
  #else /* HOMEMAIL */
! 		strdup(flags->folder, sprintf(buf, "%s/%s",
  			       MAILDIR, ((*argvp)[1])? (*argvp)[1] : "root"));
  #endif /* HOMEMAIL */
  		if ((*argvp)[1])
***************
*** 237,249 ****
  		    printf("-m: missing mailbox name.\n"), exit(1);
  		look_again = FALSE;
  	    when 'f':
! 		if (*mailfile)
  		    puts("You can't specify more than one mailbox"), exit(1);
  		if ((*argvp)[1]) {
! 		    strdup(mailfile, *++(*argvp));
  		    look_again = FALSE;
  		} else
! 		    strdup(mailfile, "&");
  	    when '1':
  		if ((*argvp)[1])
  		    strdup(cmd_help, *++(*argvp));
--- 237,249 ----
  		    printf("-m: missing mailbox name.\n"), exit(1);
  		look_again = FALSE;
  	    when 'f':
! 		if (*(flags->folder))
  		    puts("You can't specify more than one mailbox"), exit(1);
  		if ((*argvp)[1]) {
! 		    strdup(flags->folder, *++(*argvp));
  		    look_again = FALSE;
  		} else
! 		    strdup(flags->folder, "&");
  	    when '1':
  		if ((*argvp)[1])
  		    strdup(cmd_help, *++(*argvp));
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:41 1989
--- options.h	Sat Jun 24 20:02:12 1989
***************
*** 20,25 ****
--- 20,26 ----
      u_long flg;		/* Set by -v and some vars; passed to mail_someone() */
      char *src_file;	/* Set by -F */
      int src_n_exit;	/* Set by -F! */
+     char *folder;	/* Set by -f or -u */
      char f_flags[10];	/* Set by -r, -N, etc.; passed to folder() */
      char *Subj;		/* Set by -s */
      char *Cc;		/* Set by -c */
*** /tmp/,RCSt1015447	Mon Jun 26 14:35:43 1989
--- sample.mushrc	Sat Jun 24 21:45:29 1989
***************
*** 145,173 ****
  alias argv Dan Heller <island!argv at sun.com>
  alias bart Bart Schaefer <schaefer at ogccse.ogc.edu>
  alias mush-users Mush Users <mush-users-request at garp.mit.edu>
- 
- # The rest of this file demonstrates how sysadmins with novice users
- # might want to set things up.  The following "exit" should be removed.
- exit
- 
- if -e $HOME/.mushexpert
-     set quiet
-     exit
- endif
- if ! -e $HOME/.mushuser
-     echo "I see you've never used the Mush program before."
-     echo "I'll set some special flags to help you out."
-     echo "After you've used Mush a few times, you can type the command:"
-     echo -p "${prompt} expert\n"
-     echo "and the flags will no longer be set unless you put them"
-     echo "in your $HOME/.mushrc file."
-     sh touch $HOME/.mushuser	# Use sh in case $unix is not set.
-     if $?quiet
- 	unset quiet		# Show the help message on startup.
-     endif
- endif
- # At this point some helpful variables should be set.  See the list above,
- # marked as "helpful for new users", for suggestions.
- #
- # Create the "expert" command mentioned in the message above.
- cmd expert 'sh touch $HOME/.mushexpert'
--- 145,147 ----
*** /tmp/,RCSt1015728	Mon Jun 26 14:36:01 1989
--- makefile.sun	Mon Jun 26 10:54:10 1989
***************
*** 20,31 ****
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  	README-6.5 mush.1 Mailrc Gnurc sample.mushrc advanced.mushrc \
! 	cmd_help tool_help
  
  MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.xenix
  
  CFLAGS= -O -DSUNTOOL -DCURSES -DBSD
! LDFLAGS= -s
  LIBES= -lcurses -ltermlib -lsuntool -lsunwindow -lpixrect
  LINTFLAGS= -bxah -Dlint
  
--- 20,31 ----
  
  HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  	README-6.5 mush.1 Mailrc Gnurc sample.mushrc advanced.mushrc \
! 	cmd_help tool_help Mushrc
  
  MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.xenix
  
  CFLAGS= -O -DSUNTOOL -DCURSES -DBSD
! LDFLAGS=
  LIBES= -lcurses -ltermlib -lsuntool -lsunwindow -lpixrect
  LINTFLAGS= -bxah -Dlint
  
***************
*** 39,45 ****
  	@tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS)
  
  lint:
! 	make -f makefile.bsd lint
  
  clean:
  	rm -f *.o core mush
--- 39,66 ----
  	@tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS)
  
  lint:
! 	lint $(LINTFLAGS) $(SRCS) -DSUNTOOL -DCURSES -DBSD
  
  clean:
  	rm -f *.o core mush
+ 
+ BINDIR= /usr/local/bin
+ LIBDIR= /usr/local/lib
+ MRCDIR= /usr/lib
+ MANDIR= /usr/local/man/man1
+ MANEXT= 1
+ 
+ install: mush
+ 	mv mush $(BINDIR)
+ 	strip $(BINDIR)/mush
+ 	chmod 0755 $(BINDIR)/mush
+ 	rm -f $(BINDIR)/mushtool
+ 	ln -s $(BINDIR)/mush $(BINDIR)/mushtool
+ 	cp mush.1 $(MANDIR)/mush.$(MANEXT)
+ 	chmod 0644 $(MANDIR)/mush.$(MANEXT)
+ 	cp tool_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/tool_help
+ 	cp cmd_help $(LIBDIR)
+ 	chmod 0644 $(LIBDIR)/cmd_help
+ 	cp Mushrc $(MRCDIR)/Mushrc
+ 	chmod 0644 $(MRCDIR)/Mushrc
-- 
Bart Schaefer           "And if you believe that, you'll believe anything."
                                                            -- DangerMouse
CSNET / Internet                schaefer at cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer



More information about the Comp.sources.bugs mailing list