[comp.sources.bugs] elm 2.2 Patch # 7

syd@dsinc.DSI.COM (Syd Weinstein) (05/09/89)

Summary: This is an official patch for elm 2.2 system.  Please apply it.
Priority: MEDIUM

Add Xenix 286 shell instructions to README

Change cast on init signal code.
From: root@cheviot.newcastle.ac.uk (Andy Linton)

Fixed default function return for one_liner_for.
From: karl@archer.MorningStar.COM (Karl Fox)

Change command prompt on last page of message not to use
GetPrompt() which does timeouts.
From: Samuel Lam <uw-beaver!van-bc!skl>

The while loop for input of multi-line fields did not have curly braces around
the body, causing only the first statement to get executed.  This caused the
user to get stuck until ^D was typed, and no data for that field was written
to the file.  I also fixed the input routines a bit so forms work a little more
like the document says they do, though they're still not quite the same.
From: td2cad!mipos3!batie

mail_form() called mail() with a "NO" argument to tell it not to
add the Contains line; this caused the recipient of a Form to
not get it displayed in the nice readable format it's supposed
to be displayed in.
From: td2cad!mipos3!batie

Fix tab expansion near end of line in curses.c
From: Karl and Rob

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:
		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@dsinc.UUCP

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

	Subject: patch list
	send index elm

Index: hdrs/patchlevel.h
Prereq: 6
*** ../elm2.2/hdrs/patchlevel.h	Wed May  3 09:35:51 1989
--- hdrs/patchlevel.h	Thu May  4 14:40:14 1989
***************
*** 1 ****
! #define PATCHLEVEL 6
--- 1 ----
! #define PATCHLEVEL 7

Index: README
*** ../elm2.2/README	Mon Apr 24 20:03:58 1989
--- README	Thu May  4 14:43:45 1989
***************
*** 10,15 ****
--- 10,47 ----
  On Microport SysV/AT machines, Configure will run correctly under
  ksh.  Obtain ksh from Microport (available to current version owners
  without additional charge) and rerun Configure using it.
+ Xenix 286 users may have the same problem, but they can work around it
+ by changing the stack size within the shell as reported a Xenix 286 Elm
+ user:
+ > I had the same problems as everyone else is reporting on Microports *nix under
+ > SCO XENIX 2.2.1.
+ > 
+ > The solution is simple, up the stack size for /bin/sh. I used 
+ > 
+ > # mv /bin/sh /bin/sh.old
+ > # cp /bin/sh.old /bin/sh
+ > # fixhdr -F 8000 /bin/sh
+ > 
+ > This may seem a bit over the top, but I put it back after!
+ > 
+ > # mv /bin/sh /bin/sh.rm
+ > # mv /bin/sh.old /bin/sh
+ > 
+ > Then wait till nobody is using /bin/sh.rm then
+ > 
+ > # rm /bin/sh.rm
+ > 
+ > That way you preserve your old shell, ( ie you don't break it ), but you
+ > get to use Configure without bus errors etc.
+ > 
+ > I hope that of use
+ > 
+ > Keith
+ > -- 
+ > UUCP ..!uunet!mcvax!ukc!slxsys!g4lzv!keith  | Keith Brazington
+ > Smart mail  keith@g4lzv.co.uk		    | 5b Northgate Rochester Kent UK
+ > Ampanet  [44.131.8.1] and [44.131.8.3]	    | +44 634 811594 Voice
+ > Packet  G4LZV @ GB7UWS -- G4LZV USENET BB --| +44 634 401210 Data v22,v22bis
  
  Also on Microport SysV/AT Machines, the C compiler produces improper code
  for one of the arithmetic calls.  To fix this problem it is necessary to

Index: doc/Alias.guide
Prereq: 2.8
*** ../elm2.2/doc/Alias.guide	Sat Mar 25 21:44:48 1989
--- doc/Alias.guide	Thu May  4 14:49:10 1989
***************
*** 1,4 ****
! \" @(#)$Id: Alias.guide,v 2.8 89/03/25 21:44:47 syd Exp $
  \"
  \"  A guide to the ELM alias system and so on.
  \"  format with:
--- 1,4 ----
! \" @(#)$Id: Alias.guide,v 2.9 89/05/04 14:48:47 syd Exp $
  \"
  \"  A guide to the ELM alias system and so on.
  \"  format with:
***************
*** 11,16 ****
--- 11,20 ----
  \"	Syd Weinstein		elm@dsinc.UUCP (dsinc!elm)
  \"
  \"  $Log:	Alias.guide,v $
+ \" Revision 2.9  89/05/04  14:48:47  syd
+ \" Make pathalias sorting requirement more forceful.  Add extra %'s on pathalias
+ \" data lines in examples.
+ \" 
  \" Revision 2.8  89/03/25  21:44:47  syd
  \" Initial 2.2 Release checkin
  \" 
***************
*** 315,321 ****
  
  	\f2hostname\f1    <tab>    \f2address\f1
  
! which is then sorted alphabetically and stored in the file
  pointed to by \f2pathfile\f1 for \f3Elm\f1 (and other 
  programs) to use.
  .pg
--- 319,325 ----
  
  	\f2hostname\f1    <tab>    \f2address\f1
  
! which then must be sorted alphabetically and stored in the file
  pointed to by \f2pathfile\f1 for \f3Elm\f1 (and other 
  programs) to use.
  .pg
***************
*** 329,335 ****
  machine-address MUST contain the sequence `%s' (and consequently
  any other percent signs that appear in the address must be paired)
  so that the call in the program ``sprintf(buffer, machine-address, username)''
! will generate a valid return address.
  .pg
  By way of example, here are a few entries from my own file;
  
--- 333,340 ----
  machine-address MUST contain the sequence `%s' (and consequently
  any other percent signs that appear in the address must be paired)
  so that the call in the program ``sprintf(buffer, machine-address, username)''
! will generate a valid return address.  This file must be sorted alphabetically
! for Elm to use it properly.
  .pg
  By way of example, here are a few entries from my own file;
  
***************
*** 338,346 ****
  .TS
  l l.
  HPL	%s@hplabs
! PARC	%s%Xerox.PA.COM@hplabs
! amc-hq	%s%AMC-HQ.ARPA@hplabs
! imsss	%s%%IMSSS%AI.STANFORD.EDU@hplabs
  infopro	hplabs!infopro!%s
  interleaf	sun!interleaf!%s
  .TE
--- 343,351 ----
  .TS
  l l.
  HPL	%s@hplabs
! PARC	%s%%Xerox.PA.COM@hplabs
! amc-hq	%s%%AMC-HQ.ARPA@hplabs
! imsss	%s%%IMSSS%%AI.STANFORD.EDU@hplabs
  infopro	hplabs!infopro!%s
  interleaf	sun!interleaf!%s
  .TE

Index: src/curses.c
Prereq: 2.18
*** ../elm2.2/src/curses.c	Wed Apr 26 12:12:03 1989
--- src/curses.c	Mon May  8 20:39:11 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: curses.c,v 2.18 89/04/26 11:43:03 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.18 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: curses.c,v 2.19 89/05/08 20:38:57 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.19 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log:	curses.c,v $
+  * Revision 2.19  89/05/08  20:38:57  syd
+  * Fix tab placement near eol
+  * From: Karl and Rob
+  * 
   * Revision 2.18  89/04/26  11:43:03  syd
   * This patch corrects some duplicate, unnecessary and conflicting declarations
   * of some curses functions,  which show up when compiling with gcc.
***************
*** 658,666 ****
  	} else if (ch == '\t') {
  	  putchar(ch);
  	  if((nt=next_tab(_col+1)) > prev_tab(COLUMNS))
- 	    _col = nt-1;
- 	  else
  	    _col = COLUMNS-1;
  
  	} else {
  
--- 662,670 ----
  	} else if (ch == '\t') {
  	  putchar(ch);
  	  if((nt=next_tab(_col+1)) > prev_tab(COLUMNS))
  	    _col = COLUMNS-1;
+ 	  else
+ 	    _col = nt-1;
  
  	} else {
  

Index: src/forms.c
Prereq: 2.7
*** ../elm2.2/src/forms.c	Thu Mar 30 10:35:59 1989
--- src/forms.c	Mon May  8 17:05:56 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: forms.c,v 2.7 89/03/25 21:46:23 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.7 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: forms.c,v 2.8 89/05/08 17:05:53 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.8 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log:	forms.c,v $
+  * Revision 2.8  89/05/08  17:05:53  syd
+  * The while loop for input of multi-line fields did not have curly braces around
+  * the body, causing only the first statement to get executed.  This caused the
+  * user to get stuck until ^D was typed, and no data for that field was written
+  * to the file.  I also fixed the input routines a bit so forms work a little more
+  * like the document says they do, though they're still not quite the same.
+  * From: td2cad!mipos3!batie
+  * 
+  * 
   * Revision 2.7  89/03/25  21:46:23  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 247,265 ****
  		     fprintf(fd, "%s", buffer); 	
  		     break;
              case 1 : if (buffer[0] == COLON) {
! 	             printf(
  "(Enter as many lines as needed, ending with a '.' by itself on a line)\n");
!                      while (fgets(buffer, SLEN, stdin) != NULL)
! 		       no_ret(buffer);
! 	               if (strcmp(buffer, ".") == 0)
! 	                 break;
! 	               else 
! 			 fprintf(fd,"%s\n", buffer);
  	             }
  	             else 
! 		       prompt_for_entry(buffer, fd);
  	             break;
!             default: prompt_for_multiple_entries(buffer, fd, count);
  	  }
  	}
  
--- 256,275 ----
  		     fprintf(fd, "%s", buffer); 	
  		     break;
              case 1 : if (buffer[0] == COLON) {
! 	               printf(
  "(Enter as many lines as needed, ending with a '.' by itself on a line)\n");
!                        while (fgets(buffer, SLEN, stdin) != NULL) {
! 		         no_ret(buffer);
! 	                 if (strcmp(buffer, ".") == 0)
! 	                   break;
! 	                 else 
! 			   fprintf(fd,"%s\n", buffer);
! 		       }
  	             }
  	             else 
! 		       prompt_for_entries(buffer, fd, count);
  	             break;
!             default: prompt_for_entries(buffer, fd, count);
  	  }
  	}
  
***************
*** 273,309 ****
  	return(1);
  }
  
! prompt_for_entry(buffer, fd)
  char *buffer;
  FILE *fd;
- {
- 	/** This is called with an entry of the form "prompt:" and will 
- 	    display the prompt and save the prompt and the user reply
- 	    in the file "fd"
- 	**/
- 	
- 	char mybuffer[SLEN];
- 
- 	no_ret(buffer);
- 
- 	dprint(7, (debugfile, "prompt-for-entry \"%s\"\n", buffer));
- 
- 	printf("%s ", buffer);	fflush(stdout);
- 
- 	fgets(mybuffer, SLEN, stdin);
- 
- 	fprintf(fd, "%s: %s", buffer, mybuffer);
- }
- 
- prompt_for_multiple_entries(buffer, fd, entries)
- char *buffer;
- FILE *fd;
  int  entries;
  {
! 	/** Almost the same as the above routine, this one deals with lines
! 	    that have multiple colons on them.  It must first figure out how
! 	    many spaces to allocate for each field then prompts the user, 
! 	    line by line, for the entries...
  	**/
  
  	char mybuffer[SLEN], prompt[SLEN], spaces[SLEN];
--- 283,296 ----
  	return(1);
  }
  
! prompt_for_entries(buffer, fd, entries)
  char *buffer;
  FILE *fd;
  int  entries;
  {
! 	/** deals with lines that have multiple colons on them.  It must first
! 	    figure out how many spaces to allocate for each field then prompts
! 	    the user, line by line, for the entries...
  	**/
  
  	char mybuffer[SLEN], prompt[SLEN], spaces[SLEN];
***************
*** 339,345 ****
  	  offset += i;
  	
  	  if (field_size == 0) 	/* probably last prompt in line... */
! 	    field_size = 80 - (offset + extra_tabs);
  
  	  prompt_for_sized_entry(prompt, mybuffer, field_size);
  
--- 326,332 ----
  	  offset += i;
  	
  	  if (field_size == 0) 	/* probably last prompt in line... */
! 	    field_size = 78 - (offset + extra_tabs);
  
  	  prompt_for_sized_entry(prompt, mybuffer, field_size);
  
***************
*** 346,352 ****
  	  spaces[0] = ' ';	/* always at least ONE trailing space... */
  	  spaces[1] = '\0';
  
! 	  for (j = strlen(mybuffer); j < field_size; j++)
  	    strcat(spaces, " ");
  
  	  fprintf(fd, "%s: %s%s", prompt, mybuffer, spaces);
--- 333,340 ----
  	  spaces[0] = ' ';	/* always at least ONE trailing space... */
  	  spaces[1] = '\0';
  
! 	  /*  field_size-1 for the space spaces[] starts with  */
! 	  for (j = strlen(mybuffer); j < field_size-1; j++)
  	    strcat(spaces, " ");
  
  	  fprintf(fd, "%s: %s%s", prompt, mybuffer, spaces);
***************
*** 367,373 ****
  	dprint(7, (debugfile, "prompt-for-sized-entry \"%s\" %d chars\n", 
  		prompt, field_size));
  
! 	printf("%s : ", prompt);
  	
  	for (i=0;i<field_size; i++)
  	  putchar('_');
--- 355,361 ----
  	dprint(7, (debugfile, "prompt-for-sized-entry \"%s\" %d chars\n", 
  		prompt, field_size));
  
! 	printf("%s: ", prompt);
  	
  	for (i=0;i<field_size; i++)
  	  putchar('_');

Index: src/init.c
Prereq: 2.27
*** ../elm2.2/src/init.c	Wed May  3 09:35:57 1989
--- src/init.c	Thu May  4 14:44:54 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: init.c,v 2.27 89/05/03 09:13:06 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.27 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: init.c,v 2.28 89/05/04 14:44:52 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.28 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log:	init.c,v $
+  * Revision 2.28  89/05/04  14:44:52  syd
+  * Change cast on init signal code.
+  * From: root@cheviot.newcastle.ac.uk (Andy Linton)
+  * 
   * Revision 2.27  89/05/03  09:13:06  syd
   * Make termio defines depend on termio
   * 
***************
*** 210,216 ****
  #ifdef SV_INTERRUPT
  	alarm_vec.sv_handler = alarm_signal;
  	alarm_vec.sv_flags = SV_INTERRUPT;
! 	sigvec (SIGALRM, &alarm_vec, 0);	/* Process Timer Alarm	    */
  #else
  	signal(SIGALRM, alarm_signal);		/* Process Timer Alarm      */
  #endif
--- 214,220 ----
  #ifdef SV_INTERRUPT
  	alarm_vec.sv_handler = alarm_signal;
  	alarm_vec.sv_flags = SV_INTERRUPT;
! 	sigvec (SIGALRM, &alarm_vec, (struct sigvec *)0);	/* Process Timer Alarm	    */
  #else
  	signal(SIGALRM, alarm_signal);		/* Process Timer Alarm      */
  #endif

Index: src/mailmsg2.c
Prereq: 2.31
*** ../elm2.2/src/mailmsg2.c	Fri Apr 28 16:05:28 1989
--- src/mailmsg2.c	Mon May  8 17:09:38 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 2.31 89/04/28 14:48:21 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.31 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 2.32 89/05/08 17:09:35 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.32 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	mailmsg2.c,v $
+  * Revision 2.32  89/05/08  17:09:35  syd
+  * mail_form() called mail() with a "NO" argument to tell it not to
+  * add the Contains line; this caused the recipient of a Form to
+  * not get it displayed in the nice readable format it's supposed
+  * to be displayed in.
+  * From: td2cad!mipos3!batie
+  * 
   * Revision 2.31  89/04/28  14:48:21  syd
   * This reinstates elm 2.1 functionality of saving a copy of an outbound
   * message by name only if the folder preexists, while keeping the new
***************
*** 382,388 ****
  	strcpy(to, address);
  	strcpy(expanded_to, address);
  
! 	return(mail(FORM, NO, NO));
  }
  
  int
--- 389,395 ----
  	strcpy(to, address);
  	strcpy(expanded_to, address);
  
! 	return(mail(FORM, NO, YES));
  }
  
  int

Index: src/options.c
Prereq: 2.9
*** ../elm2.2/src/options.c	Thu Mar 30 10:36:46 1989
--- src/options.c	Mon May  8 15:57:47 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: options.c,v 2.9 89/03/25 21:46:54 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.9 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: options.c,v 2.10 89/05/08 15:57:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.10 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log:	options.c,v $
+  * Revision 2.10  89/05/08  15:57:45  syd
+  * Fixed default function return for one_liner_for.
+  * From: karl@archer.MorningStar.COM (Karl Fox)
+  * 
   * Revision 2.9  89/03/25  21:46:54  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 271,277 ****
  	/** A single-line description of the selected item... **/
  
  	ClearLine(LINES-4);
! 	Centerline(LINES-4, string);
  }
  
  sort_one_liner(sorting_by)
--- 275,282 ----
  	/** A single-line description of the selected item... **/
  
  	ClearLine(LINES-4);
! 	if (string)
! 		Centerline(LINES-4, string);
  }
  
  sort_one_liner(sorting_by)
***************
*** 361,367 ****
  	   case 'u' : return(
  "The level of knowledge you have about the ELM mail system.");
  
! 	    default : return("");	/* nothing if we don't know! */
  	}
  }
  
--- 366,372 ----
  	   case 'u' : return(
  "The level of knowledge you have about the ELM mail system.");
  
! 	    default : return(NULL);	/* nothing if we don't know! */
  	}
  }
  

Index: src/showmsg_c.c
Prereq: 2.20
*** ../elm2.2/src/showmsg_c.c	Thu Mar 30 10:37:30 1989
--- src/showmsg_c.c	Mon May  8 16:45:41 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 2.20 89/03/25 21:47:21 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.20 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: showmsg_c.c,v 2.21 89/05/08 16:45:39 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.21 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log:	showmsg_c.c,v $
+  * Revision 2.21  89/05/08  16:45:39  syd
+  * Change command prompt on last page of message not to use
+  * GetPrompt() which does timeouts.
+  * From: Samuel Lam <uw-beaver!van-bc!skl>
+  * 
   * Revision 2.20  89/03/25  21:47:21  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 280,286 ****
  	  }
  	  *msg_line = '\0';	/* null last generated message */
  
! 	  command = GetPrompt();	/* get next command from user */
  	}
  }
  
--- 285,291 ----
  	  }
  	  *msg_line = '\0';	/* null last generated message */
  
! 	  command = ReadCh();	/* get next command from user */
  	}
  }
  

-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.				Voice: (215) 947-9900
syd@DSI.COM or {bpa,vu-vlsi}!dsinc!syd	        FAX:   (215) 938-0235