[comp.mail.elm] elm patches

vns@mhres.mh.nl (Gertjan Vinkesteyn) (05/30/87)

Here are some patches due to my colleague Johan Vromans:

--
Real-Name: Gertjan Vinkesteyn, back in Holland and that is cold! not cool
UUCP and other network	  )\/(	in America: ..!seismo!mcvax!mhres!vns
  connections via mcvax	  )/\(	in Europe: ..!mcvax!mhres!vns

*** ../../elm/src/initialize.c	Tue May 26 09:58:05 1987
--- src/initialize.c	Fri May 29 16:37:37 1987
***************
*** 51,56
  	int      quit_signal(), term_signal(), ill_signal(),
  		 fpe_signal(),  bus_signal(),  segv_signal(),
  	         alarm_signal(), pipe_signal();
  	char     buffer[SLEN], *cp;
  	
  	userid  = getuid();

--- 51,60 -----
  	int      quit_signal(), term_signal(), ill_signal(),
  		 fpe_signal(),  bus_signal(),  segv_signal(),
  	         alarm_signal(), pipe_signal();
+ #ifdef SIGTSTP
+ 	int	sig_user_stop();
+ 	int	sig_return_from_user_stop();
+ #endif
  	char     buffer[SLEN], *cp;
  	
  	userid  = getuid();
***************
*** 104,109
  	
  	signal(SIGALRM, alarm_signal);		/* Process Timer Alarm	    */
  	signal(SIGPIPE, pipe_signal);		/* Illegal Pipe Operation   */
  
  	get_term_chars();
  	

--- 108,117 -----
  	
  	signal(SIGALRM, alarm_signal);		/* Process Timer Alarm	    */
  	signal(SIGPIPE, pipe_signal);		/* Illegal Pipe Operation   */
+ #ifdef SIGTSTP
+ 	signal(SIGTSTP, sig_user_stop);		/* Suspend signal from tty  */
+ 	signal(SIGCONT, sig_return_from_user_stop); /* Process Cont. signal */
+ #endif
  
  	get_term_chars();
  	
*** ../../elm/src/input_utils.c	Thu May 21 14:06:07 1987
--- src/input_utils.c	Fri May 29 16:43:33 1987
***************
*** 9,14
  #include <errno.h>
  #include <ctype.h>
  
  extern int errno;		/* system error number */
  
  unsigned alarm();

--- 9,16 -----
  #include <errno.h>
  #include <ctype.h>
  
+ #undef tolower
+ 
  extern int errno;		/* system error number */
  
  unsigned alarm();
*** ../../elm/src/mailmsg2.c	Sat May 23 22:58:21 1987
--- src/mailmsg2.c	Fri May 29 19:03:48 1987
***************
*** 85,91
  	  Raw(OFF);
  	  if (isatty(fileno(stdin))) {
  	    fclose(reply);	/* let edit-the-message open it! */
! 	    printf("To: %s\nSubject: %s\n", expanded_to, subject);
  	    strcpy(editor, "none");	/* force inline editor */
  	    if (no_editor_edit_the_message(filename)) {
  	      return(0);	/* confused?  edit_the_msg returns 1 if bad */

--- 85,91 -----
  	  Raw(OFF);
  	  if (isatty(fileno(stdin))) {
  	    fclose(reply);	/* let edit-the-message open it! */
! 	    printf("Subject: %s\nTo: %s\n", subject, expanded_to);
  	    strcpy(editor, "none");	/* force inline editor */
  	    if (no_editor_edit_the_message(filename)) {
  	      return(0);	/* confused?  edit_the_msg returns 1 if bad */
***************
*** 533,538
  	  return(NULL);		/* couldn't open it!! */
  	}
  
  #ifdef SITE_HIDING
  	if ((is_hidden_user = is_a_hidden_user(username))) {
  	  /** this is the interesting part of this trick... **/

--- 533,540 -----
  	  return(NULL);		/* couldn't open it!! */
  	}
  
+ 	fprintf(filedesc, "Subject: %s\n", subject);
+ 
  #ifdef SITE_HIDING
  	if ((is_hidden_user = is_a_hidden_user(username))) {
  	  /** this is the interesting part of this trick... **/
***************
*** 569,576
  # endif
  #endif
  
- 	fprintf(filedesc, "Subject: %s\n", subject);
- 
  	if (cc[0] != '\0')
  	  fprintf(filedesc, "Cc: %s\n", format_long(long_cc, strlen("Cc: ")));
  

--- 571,576 -----
  # endif
  #endif
  
  	if (cc[0] != '\0')
  	  fprintf(filedesc, "Cc: %s\n", format_long(long_cc, strlen("Cc: ")));
  
***************
*** 602,608
  	if (form)
  	  fprintf(filedesc, "Content-Type: mailform\n");
  
! /*	fprintf(filedesc, "X-Mailer: Elm [version %s]\n\n", VERSION);	*/
  
  	return((FILE *) filedesc);
  }

--- 602,608 -----
  	if (form)
  	  fprintf(filedesc, "Content-Type: mailform\n");
  
! /*	fprintf(filedesc, "X-Mailer: Elm [version %s]\n\n", VERSION); */
  
  	return((FILE *) filedesc);
  }
*** ../../elm/src/savecopy.c	Tue May 26 09:57:16 1987
--- src/savecopy.c	Fri May 29 17:01:11 1987
***************
*** 18,24
  
  #include <errno.h>
  
! #define  metachar(c)	(c == '+' || c == '%' || c == '+')
  
  char *format_long(), *get_arpa_date();
  char *error_name(), *error_description();

--- 18,24 -----
  
  #include <errno.h>
  
! #define  metachar(c)	(c == '+' || c == '%' || c == '=')
  
  char *format_long(), *get_arpa_date();
  char *error_name(), *error_description();
***************
*** 125,132
  
  	fprintf(save, "Date: %s\n", get_arpa_date());
  			
! 	fprintf(save,"To: %s\nSubject: %s\n", 
! 		format_long(to,strlen("To: ")), subject);
  
  	if (strlen(cc) > 0)
  	  fprintf(save,"Cc: %s\n", 

--- 125,132 -----
  
  	fprintf(save, "Date: %s\n", get_arpa_date());
  			
! 	fprintf(save,"Subject: %s\nTo: %s\n", 
! 		subject, format_long(to,strlen("To: ")));
  
  	if (strlen(cc) > 0)
  	  fprintf(save,"Cc: %s\n", 
*** ../../elm/src/signals.c	Thu May 21 14:06:02 1987
--- src/signals.c	Fri May 29 16:37:28 1987
***************
*** 74,80
  	signal(SIGPIPE, pipe_signal);
  }
  
! #ifdef BSD
  int was_in_raw_state;
  
  sig_user_stop()

--- 74,80 -----
  	signal(SIGPIPE, pipe_signal);
  }
  
! #ifdef SIGTSTP
  int was_in_raw_state;
  
  sig_user_stop()
***************
*** 82,88
  	/* This is called when the user presses a ^Z to stop the
  	   process within BSD 
  	*/
- 	int sig_user_stop;
  
  	was_in_raw_state = RawState();
  

--- 82,87 -----
  	/* This is called when the user presses a ^Z to stop the
  	   process within BSD 
  	*/
  
  	if (signal(SIGTSTP, SIG_DFL) != SIG_DFL)
  	  {
***************
*** 84,98
  	*/
  	int sig_user_stop;
  
! 	was_in_raw_state = RawState();
! 
! 	Raw(OFF);	/* turn it off regardless */
! 
! 	printf("\n\nStopped.  Use \"fg\" to return to Elm\n\n");
! 
! 	signal(SIGTSTP, sig_user_stop);
! 
! 	kill(getpid(), SIGSTOP);
  }
  
  sig_return_from_user_stop()

--- 83,95 -----
  	   process within BSD 
  	*/
  
! 	if (signal(SIGTSTP, SIG_DFL) != SIG_DFL)
! 	  {
! 		signal(SIGTSTP, SIG_DFL);
! 		was_in_raw_state = RawState();
! 	  }
! 	Raw(OFF);	/** restore parent's tty modes **/
! 	kill(0, SIGTSTP);
  }
  
  sig_return_from_user_stop()
***************
*** 99,105
  {
  	/** this is called when returning from a ^Z stop **/
  
! 	int sig_return_from_user_stop();
  
  	printf(
  	 "\nBack in Elm.  (you might need to explicitly request a redraw)\n\n");

--- 96,102 -----
  {
  	/** this is called when returning from a ^Z stop **/
  
! 	int sig_user_stop();
  
  	if (signal(SIGTSTP, sig_user_stop) == SIG_DFL)
  		signal(SIGTSTP, sig_user_stop);
***************
*** 101,106
  
  	int sig_return_from_user_stop();
  
  	printf(
  	 "\nBack in Elm.  (you might need to explicitly request a redraw)\n\n");
  

--- 98,106 -----
  
  	int sig_user_stop();
  
+ 	if (signal(SIGTSTP, sig_user_stop) == SIG_DFL)
+ 		signal(SIGTSTP, sig_user_stop);
+ 
  	printf(
  	 "\nBack in Elm.  (you might need to explicitly request a redraw)\n\n");
  
***************
*** 106,112
  
  	if (was_in_raw_state)
  	  Raw(ON);
- 
- 	signal(SIGCONT, sig_return_from_user_stop);
  }
  #endif

--- 106,110 -----
  
  	if (was_in_raw_state)
  	  Raw(ON);
  }
  #endif
*** ../../elm/hdrs/defs.h	Thu May 21 14:05:44 1987
--- hdrs/defs.h	Fri May 29 16:52:01 1987
***************
*** 253,258
      thing vital is predefined... (Thanks go to Detlev Droege for this one)
  **/
  
  #include <string.h>
  
  char *argv_zero();

--- 253,261 -----
      thing vital is predefined... (Thanks go to Detlev Droege for this one)
  **/
  
+ #ifdef BSD
+ #include <strings.h>
+ #else
  #include <string.h>
  #endif
  
***************
*** 254,259
  **/
  
  #include <string.h>
  
  char *argv_zero();
  char *bounce_off_remote();

--- 257,263 -----
  #include <strings.h>
  #else
  #include <string.h>
+ #endif
  
  char *argv_zero();
  char *bounce_off_remote();
*** ../../elm/hdrs/sysdefs.h	Wed May 27 23:35:46 1987
--- hdrs/sysdefs.h	Fri May 29 17:27:16 1987
***************
*** 51,57
      handle the blind-carbon-copy list define the following
  **/
  
! #define ALLOW_BCC
  
  /** If you have pathalias, can we get to it as a DBM file??? **/
  

--- 51,57 -----
      handle the blind-carbon-copy list define the following
  **/
  
! /* #define ALLOW_BCC */
  
  /** If you have pathalias, can we get to it as a DBM file??? **/
  

-- 
Real-Name: Gertjan Vinkesteyn, back in Holland and that is cold! not cool
UUCP and other network	  )\/(	in America: ..!seismo!mcvax!mhres!vns
  connections via mcvax	  )/\(	in Europe: ..!mcvax!mhres!vns