[comp.sources.bugs] Patch#1 to qterm, v12i025: Query terminal for its type

craig@charlie.OZ (Craig Bishop) (11/06/87)

The -f option was not working. This patch fixes the problem.

Craig Bishop 		ACSNET:	craig@charlie.oz
			ARPA:	craig%charlie.oz.au@uunet.uu.net
			UUCP:	...!uunet!munnari!charlie.oz!craig

# This is a shell archive.  Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file".  (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# patch#1

echo x - patch#1
cat > "patch#1" << '//E*O*F patch#1//'
*** /tmp/,RCSt1012541	Fri Nov  6 08:38:33 1987
--- table.c	Tue Nov  3 12:16:00 1987
***************
*** 5,11
  **		loosely based on a the original program by Michael Cooper.
  */
  
! static	char	rcsid[] = "$Header: table.c,v 1.1 87/09/30 15:26:01 craig Exp $";
  
  #include	<stdio.h>
  #include	<pwd.h>

--- 5,11 -----
  **		loosely based on a the original program by Michael Cooper.
  */
  
! static	char	rcsid[] = "$Header: table.c,v 1.2 87/11/03 12:16:28 craig Exp $";
  
  #include	<stdio.h>
  #include	<pwd.h>
***************
*** 16,22
  
  /* declare global variables */
  
! char	fixbuf[FIELDSIZ + 1];
  
  /* declare procedures */
  

--- 16,23 -----
  
  /* declare global variables */
  
! char		fixbuf[FIELDSIZ + 1];
! struct	qt	**ptermtab = termtab;	/* Remember end of table, -f switch */
  
  /* declare procedures */
  
***************
*** 68,74
  {
  	register int		line;
  	register char		*cp;
! 	register struct qt	**qtpp = termtab;
  	char			buf[BUFSIZ];
  	FILE			*fp;
  

--- 69,75 -----
  {
  	register int		line;
  	register char		*cp;
! 	register struct qt	**qtpp = ptermtab;
  	char			buf[BUFSIZ];
  	FILE			*fp;
  
***************
*** 135,140
  	(void)fclose(fp);
  	(void)free(*qtpp);
  	*qtpp = NULLQT;
  
  	if ( qtpp == &termtab[MAXTERMS - 1] )
  	{

--- 136,142 -----
  	(void)fclose(fp);
  	(void)free(*qtpp);
  	*qtpp = NULLQT;
+ 	ptermtab = qtpp;
  
  	if ( qtpp == &termtab[MAXTERMS - 1] )
  	{
//E*O*F patch#1//

exit 0