From: syd@dsinc.DSI.COM (Syd Weinstein)
Newsgroups: comp.mail.elm,comp.sources.bugs
Subject: elm 2.4 Patch #20
Followup-To: poster
Date: 5 Jan 1993 13:08:21 -0500
Organization: Datacomp Systems, Inc., Huntingdon Valley, PA 19006
NNTP-Posting-Host: dsinc.dsi.com
Summary: This is an official patch for elm 2.4 system.  Please apply it.
Priority: LOW

Fix:	From rn, say "| patch -p -N -d DIR", where DIR is your elm source
	directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch (version 2.0, latest patchlevel).

	After patching:
		sh Configure -d
		make
		make install

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	If you are missing previous patches they can be obtained from our:
	archive server.

	Syd Weinstein
	elm@DSI.COM

	The patches are available from the dsinc archive server
	Send the following message to archive-server@DSI.COM for
	a list of available patches:

	Subject: patch list
	send index elm

Index: hdrs/patchlevel.h
Prereq: "19"
*** ../elm2.4/hdrs/patchlevel.h	Thu Dec 24 18:56:58 1992
--- hdrs/patchlevel.h	Thu Dec 24 18:57:39 1992
***************
*** 1 ****
! #define PATCHLEVEL "19"
--- 1 ----
! #define PATCHLEVEL "20"

Index: src/elm.c
Prereq: 5.8
*** ../elm2.4/src/elm.c	Thu Dec 24 18:56:50 1992
--- src/elm.c	Thu Dec 24 16:42:08 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: elm.c,v 5.8 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
   *
   * This file and all associated files and documentation:
   *			Copyright (c) 1988-1992 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: elm.c,v 5.10 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
   *
   * This file and all associated files and documentation:
   *			Copyright (c) 1988-1992 USENET Community Trust
***************
*** 15,20 ****
--- 15,29 ----
   *
   *******************************************************************************
   * $Log: elm.c,v $
+  * Revision 5.10  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
+  * Revision 5.9  1992/12/16  14:33:25  syd
+  * add back missing nl on check only output
+  * From: Syd
+  *
   * Revision 5.8  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 724,730 ****
  	  "Expands to: ");
  	printf(msg);
  
! 	printf("%s", format_long(buffer, strlen(msg)));
  	}
  
  check_range()
--- 733,739 ----
  	  "Expands to: ");
  	printf(msg);
  
! 	printf("%s\n", format_long(buffer, strlen(msg)));
  	}
  
  check_range()
***************
*** 783,789 ****
  	    case '/'    :  /* scan mbox or aliases for string */
  			   if  (message_count < 1) {
  			     error1(catgets(elm_msg_cat, ElmSet,
! 				ElmNoMailToScan, "No %s to scan!"), items);
  			     fflush(stdin);
  			   }
  			   else if (pattern_match())
--- 792,798 ----
  	    case '/'    :  /* scan mbox or aliases for string */
  			   if  (message_count < 1) {
  			     error1(catgets(elm_msg_cat, ElmSet,
! 				ElmNoItemToScan, "No %s to scan!"), items);
  			     fflush(stdin);
  			   }
  			   else if (pattern_match())

Index: src/exitprog.c
Prereq: 5.1
*** ../elm2.4/src/exitprog.c	Sat Oct  3 18:58:52 1992
--- src/exitprog.c	Thu Dec 24 19:27:00 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: exitprog.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: exitprog.c,v 5.3 1992/12/25 00:26:49 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: exitprog.c,v $
+  * Revision 5.3  1992/12/25  00:26:49  syd
+  * Fix routine names
+  * From: Syd
+  *
+  * Revision 5.2  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.1  1992/10/03  22:58:40  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 49,62 ****
  	    softkeys_on();
  	  }
  	  if (changes == 1)
! 	    msg = catgets(elm_msg_cat, ElmSet, ElmAbandonChange,
! 		"Abandon change to mailbox? (y/n) ");
  	  else
! 	    msg = catgets(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
! 		"Abandon changes to mailbox? (y/n) ");
! 	  answer = want_to(msg, 'n');
  
! 	  if(answer != 'y') return -1;
  	}
  
  	fflush(stdout);
--- 58,71 ----
  	    softkeys_on();
  	  }
  	  if (changes == 1)
! 	    MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmAbandonChange,
! 		"Abandon change to mailbox? (%c/%c) "), *def_ans_yes, *def_ans_no);
  	  else
! 	    MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
! 		"Abandon changes to mailbox? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	  answer = want_to(msg, *def_ans_no, LINES-3);
  
! 	  if(answer != *def_ans_yes) return -1;
  	}
  
  	fflush(stdout);

Index: src/file.c
Prereq: 5.7
*** ../elm2.4/src/file.c	Thu Dec 24 18:56:51 1992
--- src/file.c	Thu Dec 24 19:20:39 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: file.c,v 5.7 1992/12/07 02:38:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: file.c,v 5.9 1992/12/25 00:20:32 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: file.c,v $
+  * Revision 5.9  1992/12/25  00:20:32  syd
+  * fix variable name
+  * From: Syd
+  *
+  * Revision 5.8  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.7  1992/12/07  02:38:45  syd
   * When ELM is reporting "appending to <foldername>" I never get to see
   * but a flash of light, before the message line has been replaced by a
***************
*** 177,183 ****
  			is_ordinary_file, scount = 0;
  	int mesgnum;	/* message whose address is used for save-by-name fn */
  	char	filename[SLEN], address[LONG_STRING], buffer[LONG_STRING],
! 		ch;
  	FILE *save_file;
  
  	oldstat = headers[current-1]->status;	/* remember */
--- 186,192 ----
  			is_ordinary_file, scount = 0;
  	int mesgnum;	/* message whose address is used for save-by-name fn */
  	char	filename[SLEN], address[LONG_STRING], buffer[LONG_STRING],
! 		ch, msg_buffer[SLEN], answer;
  	FILE *save_file;
  
  	oldstat = headers[current-1]->status;	/* remember */
***************
*** 281,308 ****
  	if (access(filename,ACCESS_EXISTS)== 0) {	/* already there!! */
  	    appending = 1;
  	    if (confirm_append || (confirm_files && is_ordinary_file)) {
! 		PutLine1 (LINES-2, 0,
! 			  /*
! 			   *	Well it should be like this but...
! 			  catgets (elm_msg_cat, ElmSet, ElmConfirmFiles,
! 				   "Append to an existing file `%s'? (y/n) "),
! 			   */
! 			  is_ordinary_file
! 			  ? "Append to an existing file `%s'? (y/n) n"
! 			  : "Append to mail folder `%s'? (y/n) n",
! 			  filename);
! 		ch = ReadCh ();
! 		ch = tolower (ch);
! 		PutLine2 (LINES-2, 0,
! 			  is_ordinary_file
! 			  ? "Append to an existing file `%s'? (y/n) %s"
! 			  : "Append to mail folder `%s'? (y/n) %s",
! 			  filename,
! 			  (ch == *def_ans_yes) ? "Yes" : "No");
! 		sleep (1);
! 		ClearLine (LINES-2);
  
! 		if (ch != *def_ans_yes) {
  		    goto Retry_Save_If_Not_Confirmed;
  		}
  	    }
--- 290,308 ----
  	if (access(filename,ACCESS_EXISTS)== 0) {	/* already there!! */
  	    appending = 1;
  	    if (confirm_append || (confirm_files && is_ordinary_file)) {
! 
! 	        if (is_ordinary_file)
! 	          MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesAppend,
! 		      "Append to an existing file `%s'? (%c/%c) "),
! 		    filename, *def_ans_yes, *def_ans_no);
! 	        else
! 	          MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderAppend,
! 	              "Append to mail folder `%s'? (%c/%c) "),
! 		    filename, *def_ans_yes, *def_ans_no);
! 
! 	        answer = want_to(buffer, *def_ans_no, LINES-2);
  
! 		if (answer != *def_ans_yes) {
  		    goto Retry_Save_If_Not_Confirmed;
  		}
  	    }
***************
*** 309,336 ****
  	}
  	else {
              if (confirm_create || (confirm_folders && !is_ordinary_file)) {
! 		PutLine1 (LINES-2, 0,
! 			  /*
! 			   *	Well it should be like this but...
! 			  catgets (elm_msg_cat, ElmSet, ElmConfirmFolders,
! 				   "Create a new mail folder `%s'? (y/n) "),
! 			   */
! 			  !is_ordinary_file
! 			  ? "Create a new mail folder `%s'? (y/n) n"
! 			  : "Create a new file `%s'? (y/n) n",
! 			  filename);
! 		ch = ReadCh ();
! 		ch = tolower (ch);
! 		PutLine2 (LINES-2, 0,
! 			  !is_ordinary_file
! 			  ? "Create a new mail folder `%s'? (y/n) %s"
! 			  : "Create a new file `%s'? (y/n) %s",
! 			  filename,
! 			  (ch == *def_ans_yes) ? "Yes" : "No");
! 		sleep (1);
! 		ClearLine (LINES-2);
  
! 		if (ch != *def_ans_yes) {
  		    goto Retry_Save_If_Not_Confirmed;
  		}
  	    }
--- 309,327 ----
  	}
  	else {
              if (confirm_create || (confirm_folders && !is_ordinary_file)) {
! 
! 	        if (is_ordinary_file)
! 	          MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesCreate,
! 		      "Create a new file `%s'? (%c/%c) "),
! 		    filename, *def_ans_yes, *def_ans_no);
! 	        else
! 	          MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderCreate,
! 	              "Create a new mail folder `%s'? (%c/%c) "),
! 		    filename, *def_ans_yes, *def_ans_no);
! 
! 	        answer = want_to(buffer, *def_ans_no, LINES-2);
  
! 		if (answer != *def_ans_yes) {
  		    goto Retry_Save_If_Not_Confirmed;
  		}
  	    }

Index: src/file_util.c
Prereq: 5.3
*** ../elm2.4/src/file_util.c	Thu Dec 24 18:56:51 1992
--- src/file_util.c	Wed Dec 16 09:31:06 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: file_util.c,v 5.3 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: file_util.c,v 5.4 1992/12/16 14:30:52 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log: file_util.c,v $
+  * Revision 5.4  1992/12/16  14:30:52  syd
+  * Make forward to checking consistent on sign ignoring
+  * From: Syd
+  *
   * Revision 5.3  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 226,232 ****
  	/* file has reasonable size - see if forwarding */
  	else if (mail_gets (firstline, SLEN, fp) == 0)
  	  retcode = 1;		 /* empty? should have detected this above! */
! 	else if (first_word(firstline, FORWARDSIGN))
  	  retcode = 2;					/* forwarding */
  
  	/* not forwarding - so file must have some mail in it */
--- 230,236 ----
  	/* file has reasonable size - see if forwarding */
  	else if (mail_gets (firstline, SLEN, fp) == 0)
  	  retcode = 1;		 /* empty? should have detected this above! */
! 	else if (first_word_nc(firstline, FORWARDSIGN))
  	  retcode = 2;					/* forwarding */
  
  	/* not forwarding - so file must have some mail in it */

Index: src/in_utils.c
Prereq: 5.2
*** ../elm2.4/src/in_utils.c	Tue Nov 17 14:11:04 1992
--- src/in_utils.c	Thu Dec 24 16:42:10 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.2 1992/11/15 01:15:28 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: in_utils.c,v $
+  * Revision 5.3  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.2  1992/11/15  01:15:28  syd
   * The alias message_count isn't set to zero if the last alias has
   * been deleted from the alias table. As no aliases are reread from
***************
*** 58,67 ****
  			          Writechar(BACKSPACE); fflush(stdout); }
  
  int
! want_to(question, dflt)
  char *question, dflt;
  {
! 	/** Ask 'question' on LINES-2 left enough to just leave room for an
  	    answer, returning the answer in lower case.
  	    Echo answer as full "Yes" or "No".  'dflt' is the 
  	    default answer if <return> is pressed. (Note: 'dflt' is also what 
--- 63,73 ----
  			          Writechar(BACKSPACE); fflush(stdout); }
  
  int
! want_to(question, dflt, where)
  char *question, dflt;
+ int where;
  {
! 	/** Ask 'question' on 'where' left enough to just leave room for an
  	    answer, returning the answer in lower case.
  	    Echo answer as full "Yes" or "No".  'dflt' is the 
  	    default answer if <return> is pressed. (Note: 'dflt' is also what 
***************
*** 71,79 ****
  
  	cols = COLUMNS - (strlen(question) + 5 );	/* 5 for "Yes." + 1 */
  
! 	MoveCursor(LINES-3, cols);
  	CleartoEOLN();
! 	PutLine3(LINES-3, cols,"%s%c%c", question, dflt, BACKSPACE);
  	fflush(stdout);
  	fflush(stdin);
  
--- 77,85 ----
  
  	cols = COLUMNS - (strlen(question) + 5 );	/* 5 for "Yes." + 1 */
  
! 	MoveCursor(where, cols);
  	CleartoEOLN();
! 	PutLine3(where, cols,"%s%c%c", question, dflt, BACKSPACE);
  	fflush(stdout);
  	fflush(stdin);
  
***************
*** 88,96 ****
  	  ch = dflt;
  
  	if(ch == *def_ans_yes)
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  	else
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  
  	return(ch);
  }
--- 94,102 ----
  	  ch = dflt;
  
  	if(ch == *def_ans_yes)
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYesWord, "Yes."), 0);
  	else
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoWord, "No."), 0);
  
  	return(ch);
  }

Index: src/leavembox.c
Prereq: 5.7
*** ../elm2.4/src/leavembox.c	Thu Dec 24 18:56:47 1992
--- src/leavembox.c	Thu Dec 24 16:59:21 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.7 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.9 1992/12/24 21:58:52 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: leavembox.c,v $
+  * Revision 5.9  1992/12/24  21:58:52  syd
+  * Add lstat call to properly detect symlink
+  * From: Syd via partial patch from Bryan Curnutt
+  *
+  * Revision 5.8  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.7  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 136,141 ****
--- 145,153 ----
  	FILE *temp;
  	char temp_keep_file[SLEN], buffer[SLEN];
  	struct stat    buf;		/* stat command  */
+ #ifdef SYMLINK
+ 	struct stat    lbuf;		/* lstat command  */
+ #endif
  #ifdef BSD
  	time_t utime_buffer[2];		/* utime command */
  #else
***************
*** 185,191 ****
  	    else
  	      MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveDeleteMessages,
  		"Delete messages? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	    answer = want_to(buffer, answer);
  	  }
  
  	  if(answer == *def_ans_yes) {
--- 197,203 ----
  	    else
  	      MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveDeleteMessages,
  		"Delete messages? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	    answer = want_to(buffer, answer, LINES-3);
  	  }
  
  	  if(answer == *def_ans_yes) {
***************
*** 237,243 ****
  		MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveMoveMessages,
  			"Move read messages to \"received\" folder? (%c/%c) "),
  			*def_ans_yes, *def_ans_no);
! 	      answer = want_to(buffer, answer);
  	      asked_storage_q = TRUE;
  	    }
  
--- 249,255 ----
  		MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveMoveMessages,
  			"Move read messages to \"received\" folder? (%c/%c) "),
  			*def_ans_yes, *def_ans_no);
! 	      answer = want_to(buffer, answer, LINES-3);
  	      asked_storage_q = TRUE;
  	    }
  
***************
*** 291,297 ****
  		  MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
  		    "Keep unread messages in incoming mailbox? (%c/%c) "),
  		    *def_ans_yes, *def_ans_no);
! 		answer = want_to(buffer, answer);
  	      }
  
  	      for (i = 0; i < message_count; i++) {
--- 303,309 ----
  		  MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
  		    "Keep unread messages in incoming mailbox? (%c/%c) "),
  		    *def_ans_yes, *def_ans_no);
! 		answer = want_to(buffer, answer, LINES-3);
  	      }
  
  	      for (i = 0; i < message_count; i++) {
***************
*** 577,582 ****
--- 589,604 ----
  		"Error %s on stat(%s)."), error_description(err), cur_folder);
  	}
  
+ #ifdef SYMLINK
+         if (lstat(cur_folder, &lbuf) != 0) {
+ 	  err = errno;
+ 	  dprint(1, (debugfile, "Error: errno %s attempting to stat file %s\n", 
+ 		     error_description(err), cur_folder));
+           error2(catgets(elm_msg_cat, ElmSet, ElmLeaveErrorOnStat,
+ 		"Error %s on stat(%s)."), error_description(err), cur_folder);
+ 	}
+ #endif
+ 
  	/* Close and remove the original folder.
  	 * However, if we are going to copy a temp file of kept messages
  	 * to it, and this is a locked (spool) mailbox, we need to keep
***************
*** 616,624 ****
  
  #ifdef SYMLINK
  #ifdef S_ISLNK
! 	  if (S_ISLNK(buf.st_mode))
  #else
! 	  if ((buf.st_mode & S_IFMT) == S_IFLNK)
  #endif
  	  {
  		 need_to_copy = TRUE;
--- 638,646 ----
  
  #ifdef SYMLINK
  #ifdef S_ISLNK
! 	  if (S_ISLNK(lbuf.st_mode))
  #else
! 	  if ((lbuf.st_mode & S_IFMT) == S_IFLNK)
  #endif
  	  {
  		 need_to_copy = TRUE;

Index: src/limit.c
Prereq: 5.1
*** ../elm2.4/src/limit.c	Sat Oct  3 18:59:00 1992
--- src/limit.c	Thu Dec 24 16:42:12 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: limit.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: limit.c,v 5.2 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: limit.c,v $
+  * Revision 5.2  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.1  1992/10/03  22:58:40  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 61,71 ****
  	  PutLine0(LINES-2, 0, msg);
  	  criteria[0] = ReadCh();
  	  if (tolower(criteria[0]) == *def_ans_yes) {
! 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmLimitYes, "Yes."), 0);
  	    PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitAdding,
  		"Adding criteria..."));
  	  } else {
! 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmLimitNo, "No."), 0);
  	    selected = 0;
  	    PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitChanging,
  		"Change criteria..."));
--- 66,76 ----
  	  PutLine0(LINES-2, 0, msg);
  	  criteria[0] = ReadCh();
  	  if (tolower(criteria[0]) == *def_ans_yes) {
! 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYesWord, "Yes."), 0);
  	    PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitAdding,
  		"Adding criteria..."));
  	  } else {
! 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoWord, "No."), 0);
  	    selected = 0;
  	    PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitChanging,
  		"Change criteria..."));

Index: src/mailmsg1.c
Prereq: 5.1
*** ../elm2.4/src/mailmsg1.c	Sat Oct  3 18:59:01 1992
--- src/mailmsg1.c	Thu Dec 24 16:42:13 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,29 ----
   *
   *******************************************************************************
   * $Log: mailmsg1.c,v $
+  * Revision 5.3  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
+  * Revision 5.2  1992/12/20  05:15:58  syd
+  * Add a c)hange alias, -u and -t options to listalias to list only user
+  * and only system aliases respectively.
+  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
+  *
   * Revision 5.1  1992/10/03  22:58:40  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 268,286 ****
  
  	if (strlen(subject_field) == 0) {	/* zero length subject?? */
  	  MCsprintf(msgbuf, catgets(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
! 	    "No subject - Continue with message? (%c/%c) %c%c"),
! 	    *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
! 	  PutLine0(prompt_line, 0, msgbuf);
! 
! 	  ch = ReadCh();
! 	  if (tolower(ch) != *def_ans_yes) {	/* user says no! */
! 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  	    ClearLine(prompt_line);
  	    error(catgets(elm_msg_cat, ElmSet, ElmMailNotSend, "Mail not sent."));
  	    return(0);
  	  }
  	  else {
- 	    Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  	    PutLine0(prompt_line,0,"Subject: <none>");
  	    CleartoEOLN();
  	  }
--- 278,294 ----
  
  	if (strlen(subject_field) == 0) {	/* zero length subject?? */
  	  MCsprintf(msgbuf, catgets(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
! 	    "No subject - Continue with message? (%c/%c) "),
! 	    *def_ans_yes, *def_ans_no);
! 
! 	  ch = want_to(msgbuf, *def_ans_no, prompt_line);
! 	  if (ch != *def_ans_yes) {	/* user says no! */
! 	    sleep(1);
  	    ClearLine(prompt_line);
  	    error(catgets(elm_msg_cat, ElmSet, ElmMailNotSend, "Mail not sent."));
  	    return(0);
  	  }
  	  else {
  	    PutLine0(prompt_line,0,"Subject: <none>");
  	    CleartoEOLN();
  	  }
***************
*** 364,370 ****
  	  else {
  	    MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmCopyMessageYN,
  		"Copy message? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	    answer = (want_to(msg, *def_ans_no) == *def_ans_yes);
  	  }
  	  *is_a_response = TRUE;
  	}
--- 372,378 ----
  	  else {
  	    MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmCopyMessageYN,
  		"Copy message? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	    answer = (want_to(msg, *def_ans_no, LINES-3) == *def_ans_yes);
  	  }
  	  *is_a_response = TRUE;
  	}
***************
*** 387,392 ****
--- 395,401 ----
  	**/
  
  	register int tagged = 0, i;
+ 	int ret;
  
  	/* First: zero all current global message strings */
  
***************
*** 400,407 ****
  	  if (ison(aliases[i]->status, TAGGED)) {
  	    strcat(to, aliases[i]->alias);
  	    strcat(to, " ");
- 	    clearit(aliases[i]->status, TAGGED);
- 	    show_msg_tag(i);
  	    tagged++;
  	  }
  	}
--- 409,414 ----
***************
*** 408,418 ****
  
  	if (tagged == 0) {
  	  strcpy(to, aliases[current-1]->alias);
- 	  tagged = 1;
  	}
  
! 	dprint(4, (debugfile, "%d message%s tagged for mailing (a_sndmsg)\n",
! 	        tagged, plural(tagged)));
  
  	/******* And now the real stuff! *******/
  
--- 415,424 ----
  
  	if (tagged == 0) {
  	  strcpy(to, aliases[current-1]->alias);
  	}
  
! 	dprint(4, (debugfile, "%d aliases tagged for mailing (a_sndmsg)\n",
! 	        tagged));
  
  	/******* And now the real stuff! *******/
  
***************
*** 442,449 ****
  	dprint(5, (debugfile, "bcc=\"%s\" expanded_bcc=\"%s\"\n",bcc,expanded_bcc));
  
  	main_state();
! 	i = mail(FALSE, edit_message, form_letter);
  	main_state();
  
! 	return(i);
  }
--- 448,468 ----
  	dprint(5, (debugfile, "bcc=\"%s\" expanded_bcc=\"%s\"\n",bcc,expanded_bcc));
  
  	main_state();
! 	ret = mail(FALSE, edit_message, form_letter);
  	main_state();
  
! /*
!  *	Since we got this far, it must be okay to clear the tags.
!  */
! 	i = 0;
! 	while (tagged) {
! 	    if (ison(aliases[i]->status, TAGGED)) {
! 	        clearit(aliases[i]->status, TAGGED);
! 	        show_msg_tag(i);
! 	        tagged--;
! 	    }
! 	    i++;
! 	}
! 
! 	return(ret);
  }

Index: src/mailmsg2.c
Prereq: 5.12
*** ../elm2.4/src/mailmsg2.c	Thu Dec 24 18:56:52 1992
--- src/mailmsg2.c	Mon Dec 28 09:24:38 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 5.12 1992/12/11 01:58:50 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 5.15 1992/12/28 14:24:25 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.15 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,33 ----
   *
   *******************************************************************************
   * $Log: mailmsg2.c,v $
+  * Revision 5.15  1992/12/28  14:24:25  syd
+  * Fix problem where it won't let no answer on recall last message
+  * From: Syd
+  *
+  * Revision 5.14  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
+  * Revision 5.13  1992/12/20  05:04:51  syd
+  * restore unintnded prefix_chars that caused forwarding without editing
+  * to add prefix
+  * From: Syd
+  *
   * Revision 5.12  1992/12/11  01:58:50  syd
   * Allow for use from restricted shell by putting SHELL=/bin/sh in the
   * environment of spawned mail transport program.
***************
*** 299,305 ****
  	    already_has_text = TRUE;	/* we just added it, right? */
  	  }
  	  else
! 	    copy_message(prefixchars, reply,
  		( noheader ? CM_REMOVE_HEADER : 0 ) | CM_MMDF_HEAD);
  	}
  
--- 313,319 ----
  	    already_has_text = TRUE;	/* we just added it, right? */
  	  }
  	  else
! 	    copy_message("", reply,
  		( noheader ? CM_REMOVE_HEADER : 0 ) | CM_MMDF_HEAD);
  	}
  
***************
*** 575,581 ****
  			"mailer returned error status %d"), sys_status);
  		   printf("\r\n");
  		} else {
! 		   sprintf(very_long_buffer, catgets(elm_msg_cat, ElmSet, ElmCouldNotCreateFile,
  			"mailer returned error status %d"), sys_status);
  		   set_error(very_long_buffer);
  		}
--- 589,595 ----
  			"mailer returned error status %d"), sys_status);
  		   printf("\r\n");
  		} else {
! 		   sprintf(very_long_buffer, catgets(elm_msg_cat, ElmSet, ElmMailerReturnedError,
  			"mailer returned error status %d"), sys_status);
  		   set_error(very_long_buffer);
  		}
***************
*** 642,659 ****
  		     "Recall last kept message? (%c/%c) "),
  		     *def_ans_yes, *def_ans_no);
  	  do {
! 	    PutLine0(LINES-1, 0, msg);
! 	    CleartoEOLN();
! 	    fflush(stdout);
! 	    ch = ReadCh();
! 	    ch = tolower(ch);
  	    if (ch == *def_ans_yes) {
- 	      Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);	
                retransmit++;
  	      *already_has_text = TRUE;
! 	    } else if (ch == *def_ans_no) {
! 	      Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);	
! 	    } else {
  	      Write_to_screen("%c??", 1, 07);	/* BEEP */
  	      sleep(1);
  	      ch = 0;
--- 656,666 ----
  		     "Recall last kept message? (%c/%c) "),
  		     *def_ans_yes, *def_ans_no);
  	  do {
! 	    ch = want_to(msg, '\0', LINES-1);
  	    if (ch == *def_ans_yes) {
                retransmit++;
  	      *already_has_text = TRUE;
! 	    } else if (ch != *def_ans_no) {
  	      Write_to_screen("%c??", 1, 07);	/* BEEP */
  	      sleep(1);
  	      ch = 0;
***************
*** 1196,1216 ****
  	MoveCursor(LINES,0);
  	CleartoEOLN();
  	MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmBounceOffRemote,
! 	      "\"Bounce\" a copy off the remote machine? (%c/%c) %c%c"),
! 	      *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
! 	PutLine0(LINES,0, msg);
! 	fflush(stdin);	/* wait for answer! */
! 	fflush(stdout);
! 	ch = ReadCh();
! 	if (tolower(ch) != *def_ans_yes) { 
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
! 	  fflush(stdout);
! 	  return(FALSE);
! 	}
! 	Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
! 	fflush(stdout);
! 
! 	return(TRUE);
  }
  
  
--- 1203,1212 ----
  	MoveCursor(LINES,0);
  	CleartoEOLN();
  	MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmBounceOffRemote,
! 	      "\"Bounce\" a copy off the remote machine? (%c/%c) "),
! 	      *def_ans_yes, *def_ans_no);
! 	ch = want_to(msg, *def_ans_no, LINES);
! 	return (ch == *def_ans_yes);
  }
  
  

Index: src/pattern.c
Prereq: 5.2
*** ../elm2.4/src/pattern.c	Thu Dec 24 18:56:59 1992
--- src/pattern.c	Thu Dec 24 19:30:44 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: pattern.c,v 5.2 1992/11/26 00:46:50 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: pattern.c,v 5.5 1992/12/25 00:30:37 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
   *
   *******************************************************************************
   * $Log: pattern.c,v $
+  * Revision 5.5  1992/12/25  00:30:37  syd
+  * change way message works
+  *
+  * Revision 5.4  1992/12/25  00:22:39  syd
+  * add missing *
+  * From: Syd
+  *
+  * Revision 5.3  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.2  1992/11/26  00:46:50  syd
   * Fix how errno is used so err is inited and used instead
   * as errno gets overwritten by print system call
***************
*** 58,64 ****
  meta_match(function)
  int function;
  {
! 	char	ch;
  
  	/** Perform specific function based on whether an entered string 
  	    matches either the From or Subject lines.. 
--- 70,76 ----
  meta_match(function)
  int function;
  {
! 	char	ch, tagmsg[SLEN];
  
  	/** Perform specific function based on whether an entered string 
  	    matches either the From or Subject lines.. 
***************
*** 94,117 ****
  
  	  if (tagged) {
  	    if (tagged > 1) {
! 	      PutLine1(LINES-2,0, catgets(elm_msg_cat, ElmSet, ElmSomeMessagesATagged,
  		"Some %s are already tagged."), items);
  	      MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTags,
! 		"Remove Tags? (%c/%c) %c%c"),
! 		*def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  	    } else {
! 	      PutLine1(LINES-2,0, catgets(elm_msg_cat, ElmSet, ElmAMessageATagged,
  		"One %s is already tagged."), item);
  	      MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTag,
! 		"Remove Tag? (%c/%c) %c%c"),
! 		*def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  	    }
  	
! 	    Write_to_screen(msg, 0);
! 
! 	    ch = ReadCh();
! 	    if (tolower(ch) != *def_ans_no) {	/* remove tags... */
! 	      Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  	      for (i=0; i < message_count; i++) {
  	        if (inalias)
  	          clearit(aliases[i]->status,TAGGED);
--- 106,126 ----
  
  	  if (tagged) {
  	    if (tagged > 1) {
! 	      MCsprintf(tagmsg, catgets(elm_msg_cat, ElmSet, ElmSomeMessagesATagged,
  		"Some %s are already tagged."), items);
  	      MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTags,
! 		"%s Remove Tags? (%c/%c) %c%c"),
! 		tagmsg, *def_ans_yes, *def_ans_no);
  	    } else {
! 	      MCsprintf(tagmsg, catgets(elm_msg_cat, ElmSet, ElmAMessageATagged,
  		"One %s is already tagged."), item);
  	      MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTag,
! 		"%s Remove Tag? (%c/%c) "),
! 		tagmsg, *def_ans_yes, *def_ans_no);
  	    }
  	
! 	    ch = want_to(msg, *def_ans_yes, LINES-2);
! 	    if (ch != *def_ans_no) {	/* remove tags... */
  	      for (i=0; i < message_count; i++) {
  	        if (inalias)
  	          clearit(aliases[i]->status,TAGGED);
***************
*** 119,126 ****
  	          clearit(headers[i]->status,TAGGED);
  		show_new_status(i);
  	      }
! 	    } else
! 	      Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  	  }
  	}
  	
--- 128,134 ----
  	          clearit(headers[i]->status,TAGGED);
  		show_new_status(i);
  	      }
! 	    }
  	  }
  	}
  	

Index: src/remail.c
Prereq: 5.6
*** ../elm2.4/src/remail.c	Thu Dec 24 18:57:00 1992
--- src/remail.c	Thu Dec 24 16:42:16 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: remail.c,v 5.6 1992/11/26 01:46:26 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: remail.c,v 5.7 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: remail.c,v $
+  * Revision 5.7  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.6  1992/11/26  01:46:26  syd
   * add Decode option to copy_message, convert copy_message to
   * use bit or for options.
***************
*** 118,137 ****
  	ClearLine(LINES-1);
  	ClearLine(LINES);
  	MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
! 	    "Are you sure you want to remail this message (%c/%c)? %c%c"),
! 	    *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
! 	PutLine0(LINES-1, 0, buffer);
  	fflush(stdin);
! 	fflush(stdout);
! 	ch = ReadCh();
! 	if (tolower(ch) == *def_ans_no) { /* another day, another No... */
! 	  Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  	  set_error(catgets(elm_msg_cat, ElmSet, ElmBounceCancelled,
  		"Bounce of message cancelled."));
  	  (void) unlink(filename);
  	  return(1);
  	}
- 	Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  
  	if (strcmp(sendmail, mailer) == 0
  #ifdef SITE_HIDING
--- 123,138 ----
  	ClearLine(LINES-1);
  	ClearLine(LINES);
  	MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
! 	    "Are you sure you want to remail this message (%c/%c)? "),
! 	    *def_ans_yes, *def_ans_no);
  	fflush(stdin);
! 	ch = want_to(buffer, *def_ans_yes, LINES-1);
! 	if (ch == *def_ans_no) { /* another day, another No... */
  	  set_error(catgets(elm_msg_cat, ElmSet, ElmBounceCancelled,
  		"Bounce of message cancelled."));
  	  (void) unlink(filename);
  	  return(1);
  	}
  
  	if (strcmp(sendmail, mailer) == 0
  #ifdef SITE_HIDING

Index: src/reply.c
Prereq: 5.6
*** ../elm2.4/src/reply.c	Thu Dec 24 18:57:00 1992
--- src/reply.c	Thu Dec 24 16:42:17 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: reply.c,v 5.6 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: reply.c,v 5.7 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: reply.c,v $
+  * Revision 5.7  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.6  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 306,312 ****
  		return_address,full_address));
  
  	get_reply_subj( subject, headers[current-1]->subject,
! 		  catgets(elm_msg_cat, ElmSet, ElmFilledInForm, "Re: your mail"));
  
          return_value = send_msg(return_address, full_address, subject, 
  		TRUE, NO, TRUE);
--- 311,317 ----
  		return_address,full_address));
  
  	get_reply_subj( subject, headers[current-1]->subject,
! 		  catgets(elm_msg_cat, ElmSet, ElmReYourMail, "Re: your mail"));
  
          return_value = send_msg(return_address, full_address, subject, 
  		TRUE, NO, TRUE);
***************
*** 339,345 ****
  	else {
  	  MCsprintf(subject, catgets(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
  		  "Edit outgoing message? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	  edit_msg = (want_to(subject, *def_ans_yes) != *def_ans_no);
  	}
  
  	if (strlen(headers[current-1]->subject) > 0) {
--- 344,350 ----
  	else {
  	  MCsprintf(subject, catgets(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
  		  "Edit outgoing message? (%c/%c) "), *def_ans_yes, *def_ans_no);
! 	  edit_msg = (want_to(subject, *def_ans_yes, LINES-3) != *def_ans_no);
  	}
  
  	if (strlen(headers[current-1]->subject) > 0) {

Index: src/returnadd.c
Prereq: 5.5
*** ../elm2.4/src/returnadd.c	Thu Dec 24 18:57:01 1992
--- src/returnadd.c	Sun Dec 20 00:25:14 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: returnadd.c,v 5.5 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: returnadd.c,v 5.6 1992/12/20 05:25:13 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log: returnadd.c,v $
+  * Revision 5.6  1992/12/20  05:25:13  syd
+  * Always pass three parameters to header_cmp().
+  * From: chip@tct.com (Chip Salzenberg)
+  *
   * Revision 5.5  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 231,237 ****
  	else
  	  add_site(buffer, name1, lastname);	/* get the user name too! */
  
! 	if (header_cmp(buffer, "To")) {	/* for backward compatibility */
  	  get_existing_address(buffer, msgnum);
  	  using_to = TRUE;
  	}
--- 235,241 ----
  	else
  	  add_site(buffer, name1, lastname);	/* get the user name too! */
  
! 	if (header_cmp(buffer, "To", NULL)) {	/* backward compatibility ho */
  	  get_existing_address(buffer, msgnum);
  	  using_to = TRUE;
  	}

Index: src/savecopy.c
Prereq: 5.4
*** ../elm2.4/src/savecopy.c	Thu Dec 24 18:57:01 1992
--- src/savecopy.c	Thu Dec 24 19:18:19 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: savecopy.c,v 5.4 1992/11/26 00:46:50 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: savecopy.c,v 5.6 1992/12/25 00:18:10 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: savecopy.c,v $
+  * Revision 5.6  1992/12/25  00:18:10  syd
+  * Remove editing garbage from end
+  * From: Syd
+  *
+  * Revision 5.5  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.4  1992/11/26  00:46:50  syd
   * Fix how errno is used so err is inited and used instead
   * as errno gets overwritten by print system call
***************
*** 81,87 ****
  	     *write_header_info();
  	char  buffer[SLEN],	/* read buffer 		       */
  	      savename[SLEN],	/* name of file saving into    */
! 	      ch;
  	register int
  	     is_ordinary_file;
  	int  err;
--- 90,96 ----
  	     *write_header_info();
  	char  buffer[SLEN],	/* read buffer 		       */
  	      savename[SLEN],	/* name of file saving into    */
! 	      ch, msg_buffer[SLEN], answer;
  	register int
  	     is_ordinary_file;
  	int  err;
***************
*** 143,173 ****
  		    strcpy(savename, sent_mail);
  		}
  		else {
! 		    PutLine1 (LINES-2, 0,
!                           /*
!                            *    Well it should be like this but...
! 			      catgets (elm_msg_cat, ElmSet, ElmConfirmFiles,
! 				   "Append to an existing file `%s'? (y/n) n"),
!                            */
! 			      is_ordinary_file
! 			      ? "Append to an existing file `%s'? (y/n) n"
! 			      : "Append to mail folder `%s'? (y/n) n",
! 			      savename);
! 		    ch = ReadCh ();
! 		    ch = tolower (ch);
! 		    PutLine2 (LINES-2, 0,
! 			      is_ordinary_file
! 			      ? "Append to an existing file `%s'? (y/n) %s"
! 			      : "Append to mail folder `%s'? (y/n) %s",
! 			      savename,
! 			      (ch == *def_ans_yes) ? "Yes" : "No");
! 		    sleep (1);
! 		    ClearLine (LINES-2);
  
! 		    if (ch != *def_ans_yes) {
  			strcpy(savename, sent_mail);
! 			PutLine1 (LINES-2, 0,
! 				  "Alright - saving to `%s' instead",
  				  savename);
  			sleep (3);
  			ClearLine (LINES-2);
--- 152,172 ----
  		    strcpy(savename, sent_mail);
  		}
  		else {
! 		    if (is_ordinary_file)
! 		      MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesAppend,
! 			  "Append to an existing file `%s'? (%c/%c) "),
! 			filename, *def_ans_yes, *def_ans_no);
! 		    else
! 		      MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderAppend,
! 			  "Append to mail folder `%s'? (%c/%c) "),
! 			filename, *def_ans_yes, *def_ans_no);
  
! 		    answer = want_to(buffer, *def_ans_no, LINES-2);
! 
! 		    if (answer != *def_ans_yes) {
  			strcpy(savename, sent_mail);
! 			PutLine1 (LINES-2, 0, catgets(elm_msg_cat, ElmSet, ElmSavingToInstead,
! 				  "Alright - saving to `%s' instead"),
  				  savename);
  			sleep (3);
  			ClearLine (LINES-2);
***************
*** 186,216 ****
  		    strcpy(savename, sent_mail);
  		}
  		else {
! 		    PutLine1 (LINES-2, 0,
!                           /*
!                            *    Well it should be like this but...
! 			      catgets (elm_msg_cat, ElmSet, ElmConfirmFolders,
!                                     "Create a new mail folder `%s'? (y/n) n"),
!                            */
! 			      !is_ordinary_file
! 			      ? "Create a new mail folder `%s'? (y/n) n"
! 			      : "Create a new file `%s'? (y/n) n",
! 			      savename);
! 		    ch = ReadCh ();
! 		    ch = tolower (ch);
! 		    PutLine2 (LINES-2, 0,
! 			      !is_ordinary_file
! 			      ? "Create a new mail folder `%s'? (y/n) %s"
! 			      : "Create a new file `%s'? (y/n) %s",
! 			      savename,
! 			      (ch == *def_ans_yes) ? "Yes" : "No");
! 		    sleep (1);
! 		    ClearLine (LINES-2);
  
  		    if (ch != *def_ans_yes) {
  			strcpy(savename, sent_mail);
! 			PutLine1 (LINES-2, 0,
! 				  "Alright - saving to `%s' instead",
  				  savename);
  			sleep (3);
  			ClearLine (LINES-2);
--- 185,205 ----
  		    strcpy(savename, sent_mail);
  		}
  		else {
! 		    if (is_ordinary_file)
! 		      MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesCreate,
! 			  "Create a new file `%s'? (%c/%c) "),
! 			filename, *def_ans_yes, *def_ans_no);
! 		    else
! 		      MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderCreate,
! 			  "Create a new mail folder `%s'? (%c/%c) "),
! 			filename, *def_ans_yes, *def_ans_no);
! 
! 		    answer = want_to(buffer, *def_ans_no, LINES-2);
  
  		    if (ch != *def_ans_yes) {
  			strcpy(savename, sent_mail);
! 			PutLine1 (LINES-2, 0, catgets(elm_msg_cat, ElmSet, ElmSavingToInstead,
! 				  "Alright - saving to `%s' instead"),
  				  savename);
  			sleep (3);
  			ClearLine (LINES-2);

Index: src/strings.c
Prereq: 5.2
*** ../elm2.4/src/strings.c	Mon Oct 19 13:04:09 1992
--- src/strings.c	Thu Dec 24 17:17:05 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: strings.c,v 5.2 1992/10/17 22:30:43 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: strings.c,v 5.3 1992/12/24 22:16:06 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log: strings.c,v $
+  * Revision 5.3  1992/12/24  22:16:06  syd
+  * Make copy_sans_escape expand tabs to prevent subject displays from getting messed up
+  * From: Syd via request from pgf@Cayman.COM (Paul Fox)
+  *
   * Revision 5.2  1992/10/17  22:30:43  syd
   * Force text arithimetic into unsigned for those systems
   * with signed chars
***************
*** 59,68 ****
  	    format (e.g. ^(char value + 32))
  	**/
  
! 	register int i = 0, j = 0;
  
  	while (i < len && j < len && source[i] != '\0') {
! 	  if (iscntrl(source[i]) && source[i] != '\t') {
  	     dest[j++] = '^';
  	     if (j < len)
  		dest[j++] = source[i++] + 'A' - 1;
--- 63,77 ----
  	    format (e.g. ^(char value + 32))
  	**/
  
! 	register int i = 0, j = 0, n = 0;
! 	extern int tabspacing;
  
  	while (i < len && j < len && source[i] != '\0') {
! 	  if (source[i] == '\t') {
! 	     n = next_tab(j) - j;
! 	     while (n-- && j < len)
! 		 dest[j++] = ' ';
! 	  } else if (iscntrl(source[i])) {
  	     dest[j++] = '^';
  	     if (j < len)
  		dest[j++] = source[i++] + 'A' - 1;

Index: src/syscall.c
Prereq: 5.5
*** ../elm2.4/src/syscall.c	Thu Dec 24 18:57:02 1992
--- src/syscall.c	Sun Dec 20 00:29:34 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: syscall.c,v 5.5 1992/12/11 02:05:26 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: syscall.c,v 5.6 1992/12/20 05:29:33 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,25 ----
   *
   *******************************************************************************
   * $Log: syscall.c,v $
+  * Revision 5.6  1992/12/20  05:29:33  syd
+  * Fixed where when doing ! or | and ti/te is enabled, one doesn't see the
+  * "Press any key to return to ELM:" message. because the screens are
+  * switched before the message is printed.
+  * From: Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.5  1992/12/11  02:05:26  syd
   * List_folder knew only about '=' but nothing about the rest
   * of [+=%] as one would have expected.
***************
*** 103,112 ****
  	SetXYLocation(0, 40);	/* a location not near the next request, so an absolute is used */
  	PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  		"\n\nPress any key to return to ELM: "));
! 	Raw(ON);
  	(void) getchar();
! 	if (old_raw == OFF)
! 	  Raw(OFF);
  	softkeys_on();
  	if (cursor_control)
  	  transmit_functions(ON);
--- 109,121 ----
  	SetXYLocation(0, 40);	/* a location not near the next request, so an absolute is used */
  	PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  		"\n\nPress any key to return to ELM: "));
! 	Raw(ON | NO_TITE);
  	(void) getchar();
! 	printf("\r\n");
! 	Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
! 	if (old_raw == ON)
! 	  Raw(ON);
! 
  	softkeys_on();
  	if (cursor_control)
  	  transmit_functions(ON);
***************
*** 345,353 ****
  	SetXYLocation(0, 40);	/* a location not near the next request, so an absolute is used */
  	PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  		"\n\nPress any key to return to ELM: "));
! 	if (old_raw == ON)
! 	   Raw(ON);
  	(void) getchar();
  	if (cursor_control)  transmit_functions(ON);
  
  	if (ret != 0)
--- 354,367 ----
  	SetXYLocation(0, 40);	/* a location not near the next request, so an absolute is used */
  	PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  		"\n\nPress any key to return to ELM: "));
! 
! 	Raw(ON | NO_TITE);
  	(void) getchar();
+ 	printf("\r\n");
+ 	Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
+ 	if (old_raw == ON)
+ 	  Raw(ON);
+ 
  	if (cursor_control)  transmit_functions(ON);
  
  	if (ret != 0)

Index: src/utils.c
Prereq: 5.4
*** ../elm2.4/src/utils.c	Thu Dec 24 18:57:03 1992
--- src/utils.c	Mon Jan  4 22:40:45 1993
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: utils.c,v 5.4 1992/12/11 01:45:04 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: utils.c,v 5.6 1993/01/05 03:40:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: utils.c,v $
+  * Revision 5.6  1993/01/05  03:40:45  syd
+  * Protect TSTP for those systems without it.
+  * From: kevin@cfctech.cfc.com (Kevin Darcy)
+  *
+  * Revision 5.5  1992/12/24  22:05:11  syd
+  * Some OS's, especially ULTRIX create extra continue signals
+  * that confuse Elm on exit
+  * From: Syd via patch from Bob Mason
+  *
   * Revision 5.4  1992/12/11  01:45:04  syd
   * remove sys/types.h include, it is now included by defs.h
   * and this routine includes defs.h or indirectly includes defs.h
***************
*** 150,155 ****
--- 159,178 ----
  
  	char *mk_lockname();
  
+ /*
+  *	some OS's get extra cont signal, so once this far into the
+  *	exit, ignore those signals (Especially Ultrix)
+  */
+ #ifdef SIGTSTP
+ 	signal(SIGTSTP,SIG_IGN);
+ #endif
+ #ifdef SIGSTOP
+ 	signal(SIGSTOP,SIG_IGN);
+ #endif
+ #ifdef SIGCONT
+ 	signal(SIGCONT,SIG_IGN);
+ #endif
+ 
  	dprint(1, (debugfile,
       "\nERROR: Something dreadful is happening!  Taking emergency exit!!\n\n"));
  	dprint(1, (debugfile,
***************
*** 176,202 ****
  }
  rm_temps_exit()
  {
!       char buffer[SLEN];
!       int do_cursor = RawState();
  
!       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmWriteFailedExitingIntact,
!          "\nWrite to temp file failed, exiting leaving mailbox intact!\n\n"));
!       dprint(2, (debugfile, "\nrm_temps_exit, deleteing temp files\n"));
! 
!       if (cursor_control)  transmit_functions(OFF);
!       if (hp_terminal)     softkeys_off();
!       sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
!       (void) unlink(buffer);
!       if (folder_type == SPOOL) {
!         (void) unlink(cur_tempfolder);
!       }
!       unlock();                               /* remove lock file if any */
!       if(do_cursor) {
!         MoveCursor(LINES,0);
!         NewLine();
!         Raw(OFF);
!       }
!       exit(1);
  }
  
  /*ARGSUSED*/
--- 199,244 ----
  }
  rm_temps_exit()
  {
! 	char buffer[SLEN];
! 	int do_cursor = RawState();
! 
! /*
!  *	some OS's get extra cont signal, so once this far into the
!  *	exit, ignore those signals (Especially Ultrix)
!  */
! #ifdef SIGTSTP
! 	signal(SIGTSTP,SIG_IGN);
! #endif
! #ifdef SIGSTOP
! 	signal(SIGSTOP,SIG_IGN);
! #endif
! #ifdef SIGCONT
! 	signal(SIGCONT,SIG_IGN);
! #endif
! 
! 	PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmWriteFailedExitingIntact,
! 	 "\nWrite to temp file failed, exiting leaving mailbox intact!\n\n"));
! 	dprint(2, (debugfile, "\nrm_temps_exit, deleteing temp files\n"));
! 
! 	if (cursor_control)  transmit_functions(OFF);
! 	if (hp_terminal)     softkeys_off();
! 
! 	sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
! 	(void) unlink(buffer);
! 
! 	if (folder_type == SPOOL) {
! 	    (void) unlink(cur_tempfolder);
! 	}
! 
! 	unlock();                               /* remove lock file if any */
! 
! 	if(do_cursor) {
! 	    MoveCursor(LINES,0);
! 	    NewLine();
! 	    Raw(OFF);
! 	}
  
! 	exit(1);
  }
  
  /*ARGSUSED*/
***************
*** 208,213 ****
--- 250,269 ----
  	char buffer[SLEN];
  	int do_cursor = RawState();
  
+ /*
+  *	some OS's get extra cont signal, so once this far into the
+  *	exit, ignore those signals (Especially Ultrix)
+  */
+ #ifdef SIGTSTP
+ 	signal(SIGTSTP,SIG_IGN);
+ #endif
+ #ifdef SIGSTOP
+ 	signal(SIGSTOP,SIG_IGN);
+ #endif
+ #ifdef SIGCONT
+ 	signal(SIGCONT,SIG_IGN);
+ #endif
+ 
  	dprint(2, (debugfile, "\nLeaving mailer normally (leave)\n"));
  
  	if (cursor_control)  transmit_functions(OFF);
***************
*** 240,245 ****
--- 296,315 ----
  	char buffer[SLEN];
  	int do_cursor = RawState();
  
+ /*
+  *	some OS's get extra cont signal, so once this far into the
+  *	exit, ignore those signals (Especially Ultrix)
+  */
+ #ifdef SIGTSTP
+ 	signal(SIGTSTP,SIG_IGN);
+ #endif
+ #ifdef SIGSTOP
+ 	signal(SIGSTOP,SIG_IGN);
+ #endif
+ #ifdef SIGCONT
+ 	signal(SIGCONT,SIG_IGN);
+ #endif
+ 
  	dprint(2, (debugfile, "\nLeaving mailer quietly (silently_exit)\n"));
  
  	if (cursor_control)  transmit_functions(OFF);
***************
*** 267,272 ****
--- 337,356 ----
  
  	char buffer[SLEN];
          int do_cursor = RawState();
+ 
+ /*
+  *	some OS's get extra cont signal, so once this far into the
+  *	exit, ignore those signals (Especially Ultrix)
+  */
+ #ifdef SIGTSTP
+ 	signal(SIGTSTP,SIG_IGN);
+ #endif
+ #ifdef SIGSTOP
+ 	signal(SIGSTOP,SIG_IGN);
+ #endif
+ #ifdef SIGCONT
+ 	signal(SIGCONT,SIG_IGN);
+ #endif
  
          dprint(3, (debugfile,
  	    "\nLeaving mailer due to presence of lock file (leave_locked)\n"));

Index: utils/listalias.c
Prereq: 5.5
*** ../elm2.4/utils/listalias.c	Tue Nov 17 14:11:05 1992
--- utils/listalias.c	Sun Dec 20 00:16:02 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: listalias.c,v 5.5 1992/11/15 01:24:34 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: listalias.c,v 5.6 1992/12/20 05:15:58 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: listalias.c,v $
+  * Revision 5.6  1992/12/20  05:15:58  syd
+  * Add a c)hange alias, -u and -t options to listalias to list only user
+  * and only system aliases respectively.
+  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
+  *
   * Revision 5.5  1992/11/15  01:24:34  syd
   * The situation is that the .elm/aliases file is missing, but
   * .elm/aliases.dir and .elm/aliases.pag exist (isn't serendipity
***************
*** 65,80 ****
  FILE *debugfile = stderr;
  #endif
  
  main(argc, argv)
  int argc;
  char *argv[];
  {
! 	FILE *fd_pipe, *datafile;
! 	DBZ *db;
! 	struct alias_rec alias_entry;
! 	int count = 0, len;
! 	char buffer[VERY_LONG_STRING], fd_hash[SLEN], 
! 	     fd_data[SLEN], *home;
  
  #ifdef I_LOCALE
  	setlocale(LC_ALL, "");
--- 70,90 ----
  FILE *debugfile = stderr;
  #endif
  
+ static void usage();
+ 
  main(argc, argv)
  int argc;
  char *argv[];
  {
! 	extern int optind;
! 
! 	FILE *fd_pipe;
! 
! 	int system = TRUE, user = TRUE;
! 	int err_flag = 0;
! 
! 	char buffer[SLEN], fd_data[SLEN], *home;
! 	char c;
  
  #ifdef I_LOCALE
  	setlocale(LC_ALL, "");
***************
*** 82,102 ****
  
  	elm_msg_cat = catopen("elm2.4", 0);
  
! 	if (argc > 2) {
! 	  fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasListUsage,
! 		"Usage: listalias <optional-regular-expression>\n"));
! 	  exit(1);
  	}
  
! 	home = getenv("HOME");
! 
! 	sprintf(fd_data, "%s/%s", home, ALIAS_DATA);
! 
! 	if (argc > 1)
! 	  sprintf(buffer, "egrep \"%s\" | sort", argv[1]);
  	else
! 	  sprintf(buffer, "sort");
  
  	if ((fd_pipe = popen(buffer, "w")) == NULL) {
  	  if (argc > 1) 
  	    fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasNoPipe,
--- 92,125 ----
  
  	elm_msg_cat = catopen("elm2.4", 0);
  
! 	while ((c = getopt(argc, argv, "su")) != EOF) {
! 	    switch (c) {
! 	        case 's' :
! 	            user = FALSE;
! 	            if (system == FALSE)
! 	                err_flag++;
! 	            break;
! 	        case 'u' :
! 	            system = FALSE;
! 	            if (user == FALSE)
! 	                err_flag++;
! 	            break;
! 	        case '?' :
! 	            err_flag++;
!  	    }
! 	}	
! 	if (err_flag) {
! 	    usage();
  	}
  
! 	if (optind < argc)
! 	    sprintf(buffer, "egrep \"%s\" | sort", argv[optind++]);
  	else
! 	    sprintf(buffer, "sort");
  
+ 	if (optind < argc)
+ 	    usage();
+ 
  	if ((fd_pipe = popen(buffer, "w")) == NULL) {
  	  if (argc > 1) 
  	    fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasNoPipe,
***************
*** 104,135 ****
  	  fd_pipe = stdout;
  	}
  
! 	do {
! 	    if ((db = dbz_open(fd_data, O_RDONLY, 0)) == NULL) {
  	        fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
! 		NewaliasNoOpenData, "Could not open %s data file!\n"),
! 	count? catgets(elm_msg_cat, NewaliasSet, NewaliasSystem, "system")
! 	     : catgets(elm_msg_cat, NewaliasSet, NewaliasUser, "user"));
! 	      goto next_file;
  	    }
! 	
! 	    /** Otherwise let us continue... **/
  
! 	    datafile = db->dbz_basef;
! 	    while (get_one_alias(db, &alias_entry)) {
! 		len = alias_entry.length;
! 		fread(buffer, len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
! 		alias_entry.alias += (int) buffer;
! 		alias_entry.name += (int) buffer;
! 		alias_entry.address += (int) buffer;
! 		fprintf(fd_pipe, "%-20.20s %s (%s)\n", alias_entry.alias, alias_entry.address, alias_entry.name);
! 		for (len -= sizeof(buffer); len > 0; len -= sizeof(buffer))
! 		    fread(buffer, len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
  	    }
! 
! next_file: strcpy(fd_data, system_data_file);
! 
! 	} while (++count < 2);
  
  	pclose(fd_pipe);
  
--- 127,150 ----
  	  fd_pipe = stdout;
  	}
  
! 	if (user) {
! 	    home = getenv("HOME");
! 	    sprintf(fd_data, "%s/%s", home, ALIAS_DATA);
! 	    if (print_aliases(fd_data, fd_pipe) == -1) {
  	        fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
! 		  NewaliasNoOpenData, "Could not open %s data file!\n"),
! 	          catgets(elm_msg_cat, NewaliasSet, NewaliasUser, "user"));
  	    }
! 	}
  
! 	if (system) {
! 	    strcpy(fd_data, system_data_file);
! 	    if (print_aliases(fd_data, fd_pipe) == -1) {
! 	        fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
! 		  NewaliasNoOpenData, "Could not open %s data file!\n"),
! 	          catgets(elm_msg_cat, NewaliasSet, NewaliasSystem, "system"));
  	    }
! 	}
  
  	pclose(fd_pipe);
  
***************
*** 136,189 ****
  	exit(0);
  }
  
! /* byte-ordering stuff */
! #define	MAPIN(o)	((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_conf.bytemap, db->dbz_mybmap))
! #define	MAPOUT(o)	((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_mybmap, db->dbz_conf.bytemap))
! 
! static of_t			/* transformed result */
! bytemap(ino, map1, map2)
! of_t ino;
! int *map1;
! int *map2;
  {
- 	union oc {
- 		of_t o;
- 		char c[SOF];
- 	};
- 	union oc in;
- 	union oc out;
- 	register int i;
- 
- 	in.o = ino;
- 	for (i = 0; i < SOF; i++)
- 		out.c[map2[i]] = in.c[map1[i]];
- 	return(out.o);
- }
  
! get_one_alias(db, ar)
! DBZ *db;
! struct alias_rec *ar;
! {
! /*
!  *	Get an alias (name, address, etc.) from the data file
!  */
  
! 	FILE *data_file = db->dbz_basef;
  
! 	if (data_file == NULL)
! 	    return(0);	/* no alias file, but hash exists, error condition */
  
! 	if (fread((char *) ar, sizeof(struct alias_rec), 1, data_file) <= 0)
! 	    return(0);
  
! 	ar->status = (int) MAPIN(ar->status);
! 	ar->alias = (char *) MAPIN(ar->alias);
! 	ar->last_name = (char *) MAPIN(ar->last_name);
! 	ar->name = (char *) MAPIN(ar->name);
! 	ar->comment = (char *) MAPIN(ar->comment);
! 	ar->address = (char *) MAPIN(ar->address);
! 	ar->type = (int) MAPIN(ar->type);
! 	ar->length = (long) MAPIN(ar->length);
  
! 	return(1);
  }
--- 151,195 ----
  	exit(0);
  }
  
! int
! print_aliases(fd_data, fd_pipe)
! char *fd_data;
! FILE *fd_pipe;
  {
  
! 	FILE *datafile;
! 	DBZ *db;
! 	struct alias_rec alias_entry;
! 	int len;
  
! 	char buffer[VERY_LONG_STRING];
  
! 	if ((db = dbz_open(fd_data, O_RDONLY, 0)) == NULL) {
! 	    return(-1);
! 	}
! 	
! 	/** Otherwise let us continue... **/
  
! 	datafile = db->dbz_basef;
! 	while (read_one_alias(db, &alias_entry)) {
! 	    len = alias_entry.length;
! 	    fread(buffer,
! 		len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
! 	    alias_entry.alias += (int) buffer;
! 	    alias_entry.name += (int) buffer;
! 	    alias_entry.address += (int) buffer;
! 	    fprintf(fd_pipe, "%-20.20s %s (%s)\n",
! 		alias_entry.alias, alias_entry.address, alias_entry.name);
! 	    for (len -= sizeof(buffer); len > 0; len -= sizeof(buffer))
! 	        fread(buffer,
! 		    len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
! 	}
  
! }
  
! static void usage()
! {
! 	fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasListUsage,
! 	    "Usage: listalias [ -s | -u ] <optional-regular-expression>\n"));
! 	exit(1);
  }

Index: src/a_quit.c
Prereq: 5.2
*** ../elm2.4/src/a_quit.c	Thu Dec 24 18:56:46 1992
--- src/a_quit.c	Thu Dec 24 16:42:06 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: a_quit.c,v 5.2 1992/12/11 02:09:06 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: a_quit.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: a_quit.c,v $
+  * Revision 5.3  1992/12/24  21:42:01  syd
+  * Fix messages and nls messages to match.  Plus use want_to
+  * where appropriate.
+  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
+  *
   * Revision 5.2  1992/12/11  02:09:06  syd
   * Fix where the user creates a first new alias, then deletes it, the
   * alias stays on screen, but the file really will be empty if it was the
***************
*** 101,107 ****
  			"Delete %d aliases? (%c/%c) "),
  			marked_deleted, *def_ans_yes, *def_ans_no);
  	                    
! 	    answer = want_to(buffer, answer);
  	  }
  
  	  if(answer == *def_ans_yes) {
--- 106,112 ----
  			"Delete %d aliases? (%c/%c) "),
  			marked_deleted, *def_ans_yes, *def_ans_no);
  	                    
! 	    answer = want_to(buffer, answer, LINES-3);
  	  }
  
  	  if(answer == *def_ans_yes) {

Index: lib/mk_aliases.c
Prereq: 5.6
*** ../elm2.4/lib/mk_aliases.c	Thu Dec 24 18:56:45 1992
--- lib/mk_aliases.c	Tue Jan  5 12:52:14 1993
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.6 1992/12/11 02:10:24 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.7 1993/01/05 17:52:14 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log: mk_aliases.c,v $
+  * Revision 5.7  1993/01/05  17:52:14  syd
+  * Add missing quote check to whitespace error check loop
+  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
+  *
   * Revision 5.6  1992/12/11  02:10:24  syd
   * Make Elm complain about spaces that are not after commas in
   * alias and address lists
***************
*** 414,420 ****
  	    if (*s == '\\') {
  		s++;
  		continue;
! 		}
  
  	    if (*s == '"')
  		in_quote = !in_quote;
--- 418,424 ----
  	    if (*s == '\\') {
  		s++;
  		continue;
! 	    }
  
  	    if (*s == '"')
  		in_quote = !in_quote;
***************
*** 438,444 ****
  	    return;
  	}
  
- 	addresses = s + 1;			/* REDUNDANT !?!?! */
  /*
   *	Remove trailing whitespace from second field
   */
--- 442,447 ----
***************
*** 489,505 ****
  /*
   *	Now strip out any whitespace (and make sure it was
   *	legal whitespace).  Legal whitespace follows ','.
   */
  	for (s = addresses, out = addresses; *s; s++) {
! 	    if (whitespace(*s)) {
! 	        if (*(out-1) != ',') {
  	            err_flag++;			/* Keep going for now */
- 		    *out++ = *s;
  	        }
  	    }
! 	    else {
! 		*out++ = *s;
! 	    }
  	}
  	*out = '\0';
  
--- 492,513 ----
  /*
   *	Now strip out any whitespace (and make sure it was
   *	legal whitespace).  Legal whitespace follows ','.
+  *	Don't mess with white space in quotes.
   */
+ 	in_quote = FALSE;			/* Just for safety */
  	for (s = addresses, out = addresses; *s; s++) {
! 	    if (*s == '"')
! 		in_quote = !in_quote;
! 
! 	    if (!in_quote && whitespace(*s)) {
! 	        if (*(out-1) == ',') {
! 	            continue;
! 	        }
! 	        else {
  	            err_flag++;			/* Keep going for now */
  	        }
  	    }
! 	    *out++ = *s;
  	}
  	*out = '\0';
  

-- 
========================================================================
Sydney S. Weinstein, CDP, CCP          Elm Coordinator - Current 2.4PL20
Datacomp Systems, Inc.                 Projected 3.0 Release: ??? ?,1994
syd@DSI.COM or dsinc!syd      Voice: (215) 947-9900, FAX: (215) 938-0235