From:	SMTP%"wht@n4hgf.atl.ga.us" 20-FEB-1995 09:10:41.47
To:	USRC
CC:	
Subj:	v47i070: ecu - ECU Asynchronous Communications v3.30, Patch03d/4

Resent-Date: 18 Feb 1995 20:16:36 -0600
Path: decwrl!enews.sgi.com!lll-winken.llnl.gov!uwm.edu!cs.utexas.edu!uunet!sparky!not-for-mail
From: wht@n4hgf.atl.ga.us (Warren Tucker)
Newsgroups: comp.sources.misc
Subject: v47i070: ecu - ECU Asynchronous Communications v3.30, Patch03d/4
Followup-To: comp.sources.d
Date: 18 Feb 1995 20:16:36 -0600
Organization: Sterling Software
Lines: 2169
Sender: kent@sparky.sterling.com
Approved: kent@sparky.sterling.com
Message-Id: <3i69m4$2cl@sparky.sterling.com>
References: <csm-v47i067=ecu.201430@sparky.sterling.com>
Nntp-Posting-Host: sparky.sterling.com
X-Md4-Signature: 2b0bfa5b79b4da15a55076434dfc837f
To: unix-sources@pa.dec.com
Resent-Message-Id: <"_GcOJ.0.6_1.6ygHl"@ftp-gw-1.pa.dec.com>
Resent-From: unix-sources@pa.dec.com
X-Mailing-List: <unix-sources@pa.dec.com> archive/latest/489
X-Loop: unix-sources@pa.dec.com
Precedence: list
Resent-Sender: unix-sources-request@pa.dec.com

Submitted-by: wht@n4hgf.atl.ga.us (Warren Tucker)
Posting-number: Volume 47, Issue 70
Archive-name: ecu/patch03d
Environment: SCO,SCOXENIX,MOTOROLA,HP-UX,LINUX,NetBSD,SUNOS,SYSVR4,SOLARIS2,FreeBSD
Patch-To: ecu: Volume 42, Issue 99-135

#-------------------------------------------------------
# PATCH3.04
# created by gendiff x1.33 on 17 Feb 1995 20:21 UTC
#-------------------------------------------------------
*** ../ecu-3.32/ecuxkey.h	Wed May  4 04:39:13 1994
--- ecuxkey.h	Thu Jan 12 15:19:59 1995
***************
*** 1,13 ****
  /*+-------------------------------------------------------------------------
  	ecuxkey.h -- function key single char value mapping
  	wht@n4hgf.atl.ga.us
  
- NOTE: all of these codes must be in the range 0x80 <= c <= 0xFD
- International considerations make changing the ALT+[a-z] codes
- unadvisable.
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:09-17-1992-05:16-wht@n4hgf-finally, 0xE1-0xFA as promised in 3.10  */
  /*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
  /*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
--- 1,11 ----
  /*+-------------------------------------------------------------------------
  	ecuxkey.h -- function key single char value mapping
  	wht@n4hgf.atl.ga.us
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:19-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:09-17-1992-05:16-wht@n4hgf-finally, 0xE1-0xFA as promised in 3.10  */
  /*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
  /*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
***************
*** 25,69 ****
   * these are not changeable: they map to the last character in
   * an AT/"ANSI" function key sequence
   */
  
! #define XFcurup		(0x80 | 'A')	/* 0xC1 */
! #define XFcurdn		(0x80 | 'B')	/* 0xC2 */
! #define XFcurrt		(0x80 | 'C')	/* 0xC3 */
! #define XFcurlf		(0x80 | 'D')	/* 0xC4 */
! #define XFcur5		(0x80 | 'E')	/* 0xC5 */
! #define XFend		(0x80 | 'F')	/* 0xC6 */
! #define XFpgdn		(0x80 | 'G')	/* 0xC7 */
! #define XFhome		(0x80 | 'H')	/* 0xC8 */
! #define XFpgup		(0x80 | 'I')	/* 0xC9 */
! #define XFins		(0x80 | 'L')	/* 0xCA */
! #define XF1			(0x80 | 'M')	/* 0xCB */
! #define XF2			(0x80 | 'N')	/* 0xCC */
! #define XF3			(0x80 | 'O')	/* 0xCD */
! #define XF4			(0x80 | 'P')	/* 0xCE */
! #define XF5			(0x80 | 'Q')	/* 0xCF */
! #define XF6			(0x80 | 'R')	/* 0xD0 */
! #define XF7			(0x80 | 'S')	/* 0xD1 */
! #define XF8			(0x80 | 'T')	/* 0xD2 */
! #define XF9			(0x80 | 'U')	/* 0xD3 */
! #define XF10		(0x80 | 'V')	/* 0xD4 */
! #define XF11		(0x80 | 'W')	/* 0xD5 */
! #define XF12		(0x80 | 'X')	/* 0xD6 */
! #define XFbktab		(0x80 | 'Z')	/* 0xD7 */
  
  /*
   * special codes for non-ANSI keyboard support
   * These are really cleverly disguised magic numbers:
   * they HAVE to have the values used below.
   */
! #define XF_no_way	0xFE
! #define XF_not_yet	0xFF
  
  /*
   * extended ALT+[a-z] codes
   */
! #define XF_ALTA	0xE1		 /* depends on /usr/lib/keyboard keys ... */
! #define XF_ALTZ	((unsigned)(0xE1+'z'-'a'))	/* ... mapping ALT-a to 0xE0,
  											 * etc */
  
  #endif /* _ecuxkey_h */
  
--- 23,67 ----
   * these are not changeable: they map to the last character in
   * an AT/"ANSI" function key sequence
   */
  
! #define XFcurup         (0x100 | 'A')
! #define XFcurdn         (0x100 | 'B')
! #define XFcurrt         (0x100 | 'C')
! #define XFcurlf         (0x100 | 'D')
! #define XFcur5          (0x100 | 'E')
! #define XFend           (0x100 | 'F')
! #define XFpgdn          (0x100 | 'G')
! #define XFhome          (0x100 | 'H')
! #define XFpgup          (0x100 | 'I')
! #define XFins           (0x100 | 'L')
! #define XF1                     (0x100 | 'M')
! #define XF2                     (0x100 | 'N')
! #define XF3                     (0x100 | 'O')
! #define XF4                     (0x100 | 'P')
! #define XF5                     (0x100 | 'Q')
! #define XF6                     (0x100 | 'R')
! #define XF7                     (0x100 | 'S')
! #define XF8                     (0x100 | 'T')
! #define XF9                     (0x100 | 'U')
! #define XF10            (0x100 | 'V')
! #define XF11            (0x100 | 'W')
! #define XF12            (0x100 | 'X')
! #define XFbktab         (0x100 | 'Z')
  
  /*
   * special codes for non-ANSI keyboard support
   * These are really cleverly disguised magic numbers:
   * they HAVE to have the values used below.
   */
! #define XF_no_way       (0x100 | 0xFE)
! #define XF_not_yet      (0x100 | 0xFF)
  
  /*
   * extended ALT+[a-z] codes
   */
! #define XF_ALTA (0x100 | 0xE1)             /* depends on /usr/lib/keyboard keys ... */
! #define XF_ALTZ ((unsigned)((0x100 | 0xE1)+'z'-'a'))      /* ... mapping ALT-a to 0xE0,
  											 * etc */
  
  #endif /* _ecuxkey_h */
  
*** ../ecu-3.32/funckeymap.c	Wed May  4 04:39:21 1994
--- funckeymap.c	Thu Jan 12 15:20:00 1995
***************
*** 13,20 ****
--- 13,21 ----
  	funckeymap_read(name)
  
  ------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:03-27-1993-17:48-wht@n4hgf-SVR4 found mk_char_graphic decl out of scope */
  /*:09-16-1992-13:33-wht@n4hgf-add fkmap -l name */
  /*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
***************
*** 333,341 ****
  	funckeymap(buf,buflen) - map char sequence to ikde code
  
  return XF_ code or XF_not_yet if no match yet, XF_no_way if no match possible
  --------------------------------------------------------------------------*/
! uchar
  funckeymap(buf, buflen)
  uchar *buf;
  int buflen;
  {
--- 334,342 ----
  	funckeymap(buf,buflen) - map char sequence to ikde code
  
  return XF_ code or XF_not_yet if no match yet, XF_no_way if no match possible
  --------------------------------------------------------------------------*/
! uint
  funckeymap(buf, buflen)
  uchar *buf;
  int buflen;
  {
*** ../ecu-3.32/gendiff.c	Wed May  4 04:39:28 1994
--- gendiff.c	Thu Jan 12 15:20:01 1995
***************
*** 90,97 ****
--- 90,98 ----
       cc -o gendiff gendiff.c
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:12-16-1993-03:39-wht@n4hgf-add cond. compilation for fcntl vs sys/time */
  /*:12-16-1993-03:39-wht@n4hgf-add cond. compilation for CONTEXT_DIFF */
  /*:03-17-1993-15:46-wht@n4hgf-first diff shorter to make room for verbiage */
***************
*** 98,106 ****
  /*:03-17-1993-15:14-wht@n4hgf-use 4 lines of context */
  /*:04-24-1990-01:57-wht@n4hgf-document for shar-list */
  /*:04-14-1990-15:16-wht-creation */
  
! #if defined(SVR4) || defined(LINUX) || defined(sun) || defined(BSD)
  #define CONTEXT_DIFF "diff -c"
  #else /* count on GNU diff */
  #define CONTEXT_DIFF "gnudiff -d -C 4"
  #endif
--- 99,107 ----
  /*:03-17-1993-15:14-wht@n4hgf-use 4 lines of context */
  /*:04-24-1990-01:57-wht@n4hgf-document for shar-list */
  /*:04-14-1990-15:16-wht-creation */
  
! #if defined(SVR4) || defined(LINUX) || defined(sun) || defined(BSD) || defined(__FreeBSD__)
  #define CONTEXT_DIFF "diff -c"
  #else /* count on GNU diff */
  #define CONTEXT_DIFF "gnudiff -d -C 4"
  #endif
*** ../ecu-3.32/hdbintf.c	Wed May  4 04:39:30 1994
--- hdbintf.c	Sun Jan 15 02:49:17 1995
***************
*** 53,60 ****
--- 53,62 ----
    A Brief History of Time     In computing, there are no such prizes. -me
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-15-1995-02:49-wht@gyro-_ungetty_return_line might have been unused */
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:01-23-1994-14:48-wht@n4hgf-do not die on illogical utmp status, just flunk */
  /*:01-04-1994-06:31-wht@n4hgf-last_Speed_result improvement */
  /*:12-02-1993-15:30-wht@n4hgf-hbd_choose_Any could not handle DIALOUT */
***************
*** 415,429 ****
  
  /*+-------------------------------------------------------------------------
  	_ungetty_return_line(line) - return line to "getty" status
  --------------------------------------------------------------------------*/
  static void
  _ungetty_return_line(line)
  char *line;
  {
- #if !defined(CFG_UseUngetty)
- 	return;
- #else
  	int ungetty_pid;
  	int itmp;
  
  	SIGTYPE(*original_sighdlr) ();
--- 417,429 ----
  
  /*+-------------------------------------------------------------------------
  	_ungetty_return_line(line) - return line to "getty" status
  --------------------------------------------------------------------------*/
+ #if defined(CFG_UseUngetty)
  static void
  _ungetty_return_line(line)
  char *line;
  {
  	int ungetty_pid;
  	int itmp;
  
  	SIGTYPE(*original_sighdlr) ();
***************
*** 503,512 ****
  #endif
  
  	remove_from_ungetty_list(line);
  
- #endif /* !defined(CFG_UseUngetty) */
  }							 /* end of _ungetty_return_line */
  
  /*+-------------------------------------------------------------------------
  	ungetty_return_line(line,cause) - return one or all lines to "getty"
  
--- 503,512 ----
  #endif
  
  	remove_from_ungetty_list(line);
  
  }							 /* end of _ungetty_return_line */
+ #endif /* defined(CFG_UseUngetty) */
  
  /*+-------------------------------------------------------------------------
  	ungetty_return_line(line,cause) - return one or all lines to "getty"
  
***************
*** 552,561 ****
  			if (*(line = ungetty_list[itmp]))
  				_ungetty_return_line(line);
  		}
  	}
  
- #endif /* !defined(CFG_UseUngetty) */
  }							 /* end of ungetty_return_line */
  
  /*+-------------------------------------------------------------------------
  	ungetty_return_all_but(line) - return all lines but 'line'
--- 552,561 ----
  			if (*(line = ungetty_list[itmp]))
  				_ungetty_return_line(line);
  		}
  	}
+ #endif /* defined(CFG_UseUngetty) */
  
  }							 /* end of ungetty_return_line */
  
  /*+-------------------------------------------------------------------------
  	ungetty_return_all_but(line) - return all lines but 'line'
***************
*** 1760,1767 ****
--- 1760,1777 ----
  #endif
  #if defined(B38400)
  				case B38400:
  					cptr = "38400";
+ 					break;
+ #endif
+ #if defined(B57600)
+ 				case B57600:
+ 					cptr = "57600";
+ 					break;
+ #endif
+ #if defined(B115200)
+ 				case B115200:
+ 					cptr = "115200";
  					break;
  #endif
  				default:
  					switch (wait_status)
*** ../ecu-3.32/kbdtest3.c	Wed May  4 04:39:33 1994
--- kbdtest3.c	Thu Jan 12 15:20:04 1995
***************
*** 24,31 ****
--- 24,33 ----
  	xtoasc(ch,incl_3char)
  
  ------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
+ /*:11-16-1994-19:50-wht@n4hgf-xtoasc call had only 1 arg */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:01-11-1994-15:37-wht@n4hgf-remove explicit paths from stty and sed */
  /*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
  /*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
***************
*** 337,345 ****
  		strcat(s256, " ");
  
  	while (buflen--)
  	{
! 		strcat(s256, xtoasc(*buf++));
  		if (buflen)
  			strcat(s256, " ");
  	}
  	strcat(s256, "\n");
--- 339,347 ----
  		strcat(s256, " ");
  
  	while (buflen--)
  	{
! 		strcat(s256, xtoasc(*buf++,0));
  		if (buflen)
  			strcat(s256, " ");
  	}
  	strcat(s256, "\n");
***************
*** 499,507 ****
--- 501,513 ----
  #else
  #if defined(sun)
  	fputs("SunOS\n", fpout);
  #else
+ #if defined(__FreeBSD__)
+ 	fputs("FreeBSD\n", fpout);
+ #else
  	fputs("??? OS\n", fpout);
+ #endif /* __FreeBSD__ */
  #endif /* sun */
  #endif /* MOTSVR3 */
  #endif /* ISC */
  #endif /* M_SYSV */
*** ../ecu-3.32/mk.cpio	Wed May  4 04:39:36 1994
--- mk.cpio	Tue Jan 24 18:03:57 1995
***************
*** 14,22 ****
--- 14,24 ----
  DEST=$1.Z
  DIR=`pwd`
  DIR=`basename $DIR`
  
+ 	echo "*******************************************************"
  	echo making $DEST from distribution in $DIR
+ 	echo "*******************************************************"
  	cd doc; make; cd ..
  	rm -f /tmp/ecu.cpio.fls ./cpio.fls
  	cat shar.fls > /tmp/ecu.cpio.fls
  	echo doc/ecu.man >> /tmp/ecu.cpio.fls
*** ../ecu-3.32/models/funckeymap	Wed May  4 04:39:43 1994
--- models/funckeymap	Thu Jan 12 15:18:56 1995
***************
*** 52,59 ****
--- 52,60 ----
  # sequence will appear on the screen.  Press ^D to exit the program.
  #
  #-------------------------------------------------------------------------
  #+:EDITS:
+ #:01-12-1995-15:18-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch
  #:05-04-1994-04:39-wht@n4hgf-ECU release 3.30
  #:04-24-1994-05:17-wht@n4hgf-clean up+add entries for release 3.30
  #:03-13-1994-18:38-root@fep-add rterm entry
  #:11-22-1993-23:46-wht@n4hgf-hpux
***************
*** 83,90 ****
--- 84,113 ----
  msdos
  dos
  dosansi
  test
+ cons25w
+ ansiw
+ cons25
+ ansis
+ cons25-m
+ ansis-mono
+ cons50
+ ansil
+ cons50-m
+ ansil-mono
+ cons25r
+ pc3r
+ ibmpc3r
+ cons25r-m
+ pc3r-m
+ ibmpc3r-mono
+ cons50r
+ cons50r-m
+ cons25l1
+ cons25l1-m
+ cons50l1
+ cons50l1-m
      F1:F1:          esc [ M 
      F2:F2:          esc [ N 
      F3:F3:          esc [ O 
      F4:F4:          esc [ P 
*** ../ecu-3.32/pc_scr.h	Wed May  4 04:39:55 1994
--- pc_scr.h	Thu Jan 12 15:20:05 1995
***************
*** 2,9 ****
--- 2,10 ----
  	pc_scr.h - PC/AT screen definitions
  	wht@n4hgf.atl.ga.us
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  /*:11-12-1993-11:00-wht@n4hgf-Linux changes by bob@vancouver.zadall.com */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  /*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
***************
*** 37,45 ****
  #define vanilla_RT		'+'
  #define vanilla_VR		'|'
  #define vanilla_HR		'-'
  
! #ifdef LINUX
  extern chtype sTL;
  extern chtype sTR;
  extern chtype sBL;
  extern chtype sBR;
--- 38,46 ----
  #define vanilla_RT		'+'
  #define vanilla_VR		'|'
  #define vanilla_HR		'-'
  
! #if defined(LINUX) || defined(__FreeBSD__)
  extern chtype sTL;
  extern chtype sTR;
  extern chtype sBL;
  extern chtype sBR;
*** ../ecu-3.32/pcmdtty.c	Wed May  4 04:39:57 1994
--- pcmdtty.c	Thu Jan 12 15:49:31 1995
***************
*** 347,355 ****
  int
  pcmd_vidcolor(param)
  ESD *param;
  {
! 	int erc;
  	int ntokens = 0;
  	char *tokens[3];
  	int param_index[3];
  	char tokenbuf[64];
--- 347,355 ----
  int
  pcmd_vidcolor(param)
  ESD *param;
  {
! 	int erc = eNoParameter;
  	int ntokens = 0;
  	char *tokens[3];
  	int param_index[3];
  	char tokenbuf[64];
*** ../ecu-3.32/sea/ecusea.c	Thu Jun 16 14:30:22 1994
--- sea/ecusea.c	Thu Jan 12 15:20:05 1995
***************
*** 55,62 ****
--- 55,63 ----
                credit for our work.
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:04-01-1994-20:56-wht@n4hgf-pedantic what-compatible version */
  /*:04-01-1994-20:46-wht@n4hgf-integrate rdchk here, eliminating srdchk.c */
  /*:12-23-1992-00:19-wht@n4hgf-fix partially bracketed array in getspeed */
***************
*** 644,652 ****
  char *
  sf_state_text(state)
  register state;
  {
! 	char unrecog[16];
  
  	switch (state)
  	{
  		case SFS_GND:
--- 645,653 ----
  char *
  sf_state_text(state)
  register state;
  {
! 	static char unrecog[16];
  
  	switch (state)
  	{
  		case SFS_GND:
***************
*** 1310,1324 ****
--- 1311,1335 ----
  		{4800, B4800},
  		{9600, B9600},
  		{19200, EXTA},
  		{38400, EXTB},
+ #ifdef B57600
+ 		{57600, B57600},
+ #endif
+ #ifdef B115200
+ 		{115200, B115200},
+ #endif
  		{0, 0}
  	};
  
  	for (itmp = 0; speeds[itmp].baud; itmp++)
  		if (speeds[itmp].B_code == code)
  			return (speeds[itmp].baud);
+ #ifdef B115200
+ 	return (115200);
+ #else
  	return (38400);			 /* Assume fifo if ioctl failed */
+ #endif
  }							 /* end of getspeed */
  
  /*+-------------------------------------------------------------------------
  	main(argc,argv,envp)
*** ../ecu-3.32/sea/scurses.c	Wed May  4 04:40:03 1994
--- sea/scurses.c	Tue Jan 24 17:57:02 1995
***************
*** 10,18 ****
  03|  File position:  _8______ length: _8______               |
  04|  _55____________________________________________________ | transaction
  05|  _55____________________________________________________ | last rx/tx hdr
  06|  Comm I/O: rx _8______  tx _8______ bytes                |
! 07|  Baud rate: _5___ BINARY blklen: _____ comm mode: CBREAK |
  08|  Time started: session: HH:MM:SS  this file: HH:MM:SS    |
  09|                elpased: HH:MM:SS       time: HH:MM:SS    |
  10|  Error counts: this file:  _4__  total: _6____           |
  11|  _55____________________________________________________ |  err str
--- 10,18 ----
  03|  File position:  _8______ length: _8______               |
  04|  _55____________________________________________________ | transaction
  05|  _55____________________________________________________ | last rx/tx hdr
  06|  Comm I/O: rx _8______  tx _8______ bytes                |
! 07|  Baudrate: _6____ BINARY blklen: _____ comm mode: CBREAK |
  08|  Time started: session: HH:MM:SS  this file: HH:MM:SS    |
  09|                elpased: HH:MM:SS       time: HH:MM:SS    |
  10|  Error counts: this file:  _4__  total: _6____           |
  11|  _55____________________________________________________ |  err str
***************
*** 49,56 ****
--- 49,58 ----
  	vanilla_ruling()
  
  ------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-15-1995-01:20-wht@n4hgf-clean up creeping port rot */
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:01-16-1994-15:46-wht@n4hgf-use ecumachdep.h */
  /*:12-02-1993-14:05-Robert_Broughton@mindlink.bc.c-LINUX patches */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
***************
*** 68,78 ****
  #include "../ecu_time.h"
  #include <ctype.h>
  #include <signal.h>
  
- #include "../ecumachdep.h"
- #include "../pc_scr.h"
- 
  long time();
  extern char *tzname[];
  struct tm *localtime();
  
--- 70,77 ----
***************
*** 80,87 ****
--- 79,108 ----
  #define WIN_COLS	60
  #define WIN_TOPY	2
  #define WIN_LEFTX	8
  
+ #if defined(LINUX) || defined(__FreeBSD__)
+ #define sTL ACS_ULCORNER
+ #define sTR ACS_URCORNER
+ #define sBL ACS_LLCORNER
+ #define sBR ACS_LRCORNER
+ #define sLT ACS_LTEE
+ #define sRT ACS_RTEE
+ #define sVR ACS_VLINE
+ #define sHR ACS_HLINE
+ #else
+ #include "../pc_scr.h"
+ 
+ #define sTL vanilla_TL
+ #define sTR vanilla_TR
+ #define sBL vanilla_BL
+ #define sBR vanilla_BR
+ #define sLT vanilla_LT
+ #define sRT vanilla_RT
+ #define sVR vanilla_VR
+ #define sHR vanilla_HR
+ #endif
+ 
  extern char curr_dir[];
  extern char s128[];
  extern int Filcnt;
  extern int Restricted;
***************
*** 101,125 ****
  long start_seconds;
  long elapsed_seconds;
  unsigned long total_data_chars_xfered = 0L;
  
- #ifdef LINUX
- typedef chtype Chtype;
- 
- #else
- typedef unsigned char Chtype;
- 
- #endif
- 
- Chtype sTL = at_TL;
- Chtype sTR = at_TR;
- Chtype sBL = at_BL;
- Chtype sBR = at_BR;
- Chtype sLT = at_LT;
- Chtype sRT = at_RT;
- Chtype sVR = at_VR;
- Chtype sHR = at_HR;
- 
  char *win_template[] =
  {
  /*00000000001111111111222222222233333333334444444444555555555 */
  /*01234567890123456789012345678901234567890123456789012345678 */
--- 122,129 ----
***************
*** 129,137 ****
  	"  File position:  ________ length: ________               ",	/* 3 */
  	"                                                          ",	/* 4 */
  	"  tx: ______________________  rx: ______________________  ",	/* 5 */
  	"  Comm I/O: rx ________  tx ________ bytes                ",	/* 6 */
! 	"  Baud rate: _____ BINARY blklen: 128   comm mode: ______ ",	/* 7 */
  	"  Time started: session: --:--:--  this file: --:--:--    ",	/* 8 */
  	"                elapsed: --:--:--    current: --:--:--    ",	/* 9 */
  	"  Error counts: this file:  ____  total: ______           ",	/* 10 */
  	"                                                          ",	/* 11 */
--- 133,141 ----
  	"  File position:  ________ length: ________               ",	/* 3 */
  	"                                                          ",	/* 4 */
  	"  tx: ______________________  rx: ______________________  ",	/* 5 */
  	"  Comm I/O: rx ________  tx ________ bytes                ",	/* 6 */
! 	"  Baudrate: ______ BINARY blklen: 128   comm mode: ______ ",   /* 7 */
  	"  Time started: session: --:--:--  this file: --:--:--    ",	/* 8 */
  	"                elapsed: --:--:--    current: --:--:--    ",	/* 9 */
  	"  Error counts: this file:  ____  total: ______           ",	/* 10 */
  	"                                                          ",	/* 11 */
***************
*** 140,164 ****
  /*`----------------------------------------------------------' */
  	(char *)0
  };
  
- /*+-------------------------------------------------------------------------
- 	vanilla_ruling() - use ordinary ruling characters
- --------------------------------------------------------------------------*/
- void
- vanilla_ruling()
- {
- 	sTL = vanilla_TL;
- 	sTR = vanilla_TR;
- 	sBL = vanilla_BL;
- 	sBR = vanilla_BR;
- 	sLT = vanilla_LT;
- 	sRT = vanilla_RT;
- 	sVR = vanilla_VR;
- 	sHR = vanilla_HR;
- 
- }							 /* end of vanilla_ruling */
- 
  /*+-----------------------------------------------------------------------
  	char *get_elapsed_time(elapsed_secs)
  	hh:mm:ss returned
    static string address is returned
--- 144,151 ----
***************
*** 352,386 ****
  char *title;
  {
  	register int itmp;
  
- #if defined(CONS_GET)
- 	int monitor_type;
- 
- #endif
- 
  	if (curses_installed)
  		return;
  
- #if defined(M_SYSV)
- 	if (ioctl(0, CONS_GET, &monitor_type) < 0)	/* not multiscreen */
- #ifdef M_SYSV				 /* SCO non AT console */
- 		vanilla_ruling();
- #endif
- #else
- 	vanilla_ruling();
- #endif
- #ifdef LINUX
- 	sTL = ACS_ULCORNER;
- 	sTR = ACS_URCORNER;
- 	sBL = ACS_LLCORNER;
- 	sBR = ACS_LRCORNER;
- 	sLT = ACS_LTEE;
- 	sRT = ACS_RTEE;
- 	sVR = ACS_VLINE;
- 	sHR = ACS_HLINE;
- #endif
- 
  	initscr();
  	crmode();
  	noecho();
  	nonl();
--- 339,349 ----
***************
*** 387,395 ****
  	clear();
  	curses_installed = 1;
  	win = newwin(WIN_LINES, WIN_COLS, WIN_TOPY, WIN_LEFTX);
  	box(win, sVR, sHR);
! #if !defined(SVR4) && !defined(LINUX)
  	wmove(win, 0, 0);
  	waddch(win, sTL);
  	wmove(win, win->_maxy - 1, 0);
  	waddch(win, sBL);
--- 350,358 ----
  	clear();
  	curses_installed = 1;
  	win = newwin(WIN_LINES, WIN_COLS, WIN_TOPY, WIN_LEFTX);
  	box(win, sVR, sHR);
! #ifndef __FreeBSD__
  	wmove(win, 0, 0);
  	waddch(win, sTL);
  	wmove(win, win->_maxy - 1, 0);
  	waddch(win, sBL);
***************
*** 409,417 ****
  #ifdef SVR4
  	whline(win, (unsigned long)(sHR & 0x00ff), 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
! #ifdef LINUX
  	whline(win, sHR, 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
  	waddch(win, sHR);
--- 372,380 ----
  #ifdef SVR4
  	whline(win, (unsigned long)(sHR & 0x00ff), 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
! #if defined(LINUX) || defined(__FreeBSD__)
  	whline(win, sHR, 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
  	waddch(win, sHR);
***************
*** 527,536 ****
  char *mode;
  {
  	char s16[16];
  
! 	wmove(win, 7, 14);
! 	sprintf(s16, "%5u", baud_rate);
  	waddstr(win, s16);
  	clear_area(win, 7, 52, 6);
  	waddstr(win, mode);
  	wrefresh(win);
--- 490,499 ----
  char *mode;
  {
  	char s16[16];
  
! 	wmove(win, 7, 13);
! 	sprintf(s16, "%6u", baud_rate);
  	waddstr(win, s16);
  	clear_area(win, 7, 52, 6);
  	waddstr(win, mode);
  	wrefresh(win);
*** ../ecu-3.32/ugtext.c	Wed May  4 04:40:09 1994
--- ugtext.c	Thu Jan 12 15:50:55 1995
***************
*** 6,13 ****
--- 6,14 ----
  	UG_text(ugstat)
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:50-wht@n4hgf-remove unnecessary break statements */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:04-17-1994-17:58-wht@n4hgf-creation */
  
  #include "ecuungetty.h"
***************
*** 24,74 ****
  	switch (ugstat)
  	{
  		case UG_NOTENAB:
  			return ("line not enabled");
- 			break;
  		case UG_RESTART:
  			return ("restart needed");
- 			break;
  		case UG_FAIL:
  			return ("line in use");
- 			break;
  		case UGE_T_LOGIN:
  			return ("-t found US_LOGIN");
- 			break;
  		case UGE_T_LOGGEDIN:
  			return ("-t found US_LOGGGEDIN");
- 			break;
  		case UGE_T_NOTFOUND:
  			return ("not found");
- 			break;
  		case UGE_BADSWITCH:
  			return ("usage: bad switch");
- 			break;
  		case UGE_BADARGC:
  			return ("usage: bad arg count");
- 			break;
  		case UGE_BADARGV:
  			return ("this a valid tty??");
- 			break;
  		case UGE_NOTROOT:
  			return ("not setuid root");
- 			break;
  		case UGE_CALLER:
  			return ("invalid caller");
- 			break;
  		case UGE_NOUUCP:
  			return ("cannot find uucp passwd entry");
- 			break;
  		case UGE_LOGIC:
  			return ("logic error");
- 			break;
  		case UGE_BOMB:
  			return ("core dumped or killed");
- 			break;
  		case UGE_DNE:
  			return ("did not execute");
- 			break;
  	}
  	sprintf(errant, "error %u", ugstat);
  	return (errant);
  }							 /* end of UG_text */
--- 25,60 ----
*** ../ecu-3.32/utmpstat.c	Wed May  4 04:40:10 1994
--- utmpstat.c	Thu Jan 12 15:20:07 1995
***************
*** 26,33 ****
--- 26,34 ----
  wht        p2      ttyp2            2929 Fri Apr 24 20:55:45 1992
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:10-28-1993-12:07-wht@n4hgf-Gert Doering fixes -- he be kool */
  /*:07-10-1993-18:24-wht@n4hgf-add ut_type tests */
  /*:06-26-1993-16:59-wht@n4hgf-enhance US_text */
***************
*** 57,64 ****
--- 58,68 ----
  #include "ecuungetty.h"
  #include "dialprog.h"
  #include <errno.h>
  #include <utmp.h>
+ #ifdef __FreeBSD__
+ #include <ctype.h>
+ #endif
  
  #if defined(sun)
  #define ut_id ut_host		 /* fake debug info */
  #else
***************
*** 71,80 ****
  #if defined(SVR4)
  char *utmp_file = "/var/adm/utmp";
  
  #else
  char *utmp_file = "/etc/utmp";
! 
  #endif
  
  struct utmp last_utmp;
  
--- 75,87 ----
  #if defined(SVR4)
  char *utmp_file = "/var/adm/utmp";
  
  #else
+ #ifdef _PATH_UTMP
+ char *utmp_file = _PATH_UTMP;
+ #else
  char *utmp_file = "/etc/utmp";
! #endif
  #endif
  
  struct utmp last_utmp;
  
***************
*** 85,104 ****
  thing, but System V specifies toupper() to convert to upper case
  if not already and BSD says to adjust without testing, so, two
  stupid little routines here.  ASCII only -- no EBCDIC gradoo here please.
  --------------------------------------------------------------------------*/
! char
  to_upper(ch)
! register char ch;
  {
  	return (((ch >= 'a') && (ch <= 'z')) ? ch - 0x20 : ch);
  }							 /* end of to_upper() */
  
! char
  to_lower(ch)
! register char ch;
  {
  	return (((ch >= 'A') && (ch <= 'Z')) ? ch + 0x20 : ch);
  }							 /* end of to_lower() */
  
  /*+-------------------------------------------------------------------------
  	strcmpi(s1,s2) - case-insensitive strcmp
--- 92,119 ----
  thing, but System V specifies toupper() to convert to upper case
  if not already and BSD says to adjust without testing, so, two
  stupid little routines here.  ASCII only -- no EBCDIC gradoo here please.
  --------------------------------------------------------------------------*/
! uint
  to_upper(ch)
! register uint ch;
  {
+ #ifdef __FreeBSD__
+ 	return ch > 0xFF ? ch : toupper(ch);
+ #else
  	return (((ch >= 'a') && (ch <= 'z')) ? ch - 0x20 : ch);
+ #endif
  }							 /* end of to_upper() */
  
! uint
  to_lower(ch)
! register uint ch;
  {
+ #ifdef __FreeBSD__
+ 	return ch > 0xFF ? ch : tolower(ch);
+ #else
  	return (((ch >= 'A') && (ch <= 'Z')) ? ch + 0x20 : ch);
+ #endif
  }							 /* end of to_lower() */
  
  /*+-------------------------------------------------------------------------
  	strcmpi(s1,s2) - case-insensitive strcmp
***************
*** 226,234 ****
  int
  utmp_status(line)
  char *line;
  {
! #if defined sun || defined(BSD)
  	return (US_NOTFOUND);
  #else
  	register itmp;
  	register status = US_NOTFOUND;
--- 241,249 ----
  int
  utmp_status(line)
  char *line;
  {
! #if defined sun || defined(BSD) || defined(__FreeBSD__)
  	return (US_NOTFOUND);
  #else
  	register itmp;
  	register status = US_NOTFOUND;
*** ../ecu-3.32/z/ecurz.c	Wed May  4 04:40:14 1994
--- z/ecurz.c	Fri Feb 17 14:24:10 1995
***************
*** 59,66 ****
--- 59,68 ----
            -, log protocol packets
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:02-17-1995-14:21-wht@n4hgf-apply Andrew Chernov to last 3.33 prerelease */
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:04-01-1994-20:56-wht@n4hgf-pedantic what-compatible version */
  /*:02-16-1993-13:14-wht@n4hgf-make Baudrate long for 286 */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
***************
*** 91,98 ****
--- 93,103 ----
  #include <ctype.h>
  #include <string.h>
  #include <errno.h>
  #include <fcntl.h>
+ #ifdef __FreeBSD__
+ #include <unistd.h>
+ #endif
  #include "zmodem.h"
  #include <sys/param.h>
  
  #if defined(ENAMETOOLONG)
***************
*** 102,111 ****
--- 107,118 ----
  
  extern unsigned short crctab[];
  extern int force_dumbtty;
  extern int errno;
+ #ifndef __FreeBSD__
  extern char *sys_errlist[];
  extern int sys_nerr;
+ #endif
  extern char Attn[];			 /* Attention string rx sends to tx on err */
  extern int Crc32;			 /* Display flag indicating 32 bit CRC being
  							  * received */
  extern int Rxcount;			 /* Count of data bytes received */
***************
*** 627,635 ****
  		procheader("");
  		strcpy(Pathname, *argp);
  		if (!(fout = our_fopen(Pathname, "w")))
  		{
! 			sprintf(s128, "%-0.64s: %-0.40s", Pathname, sys_errlist[errno]);
  			report_str(s128, 1);
  			ecu_log_event(getppid(), s128);
  			goto FAIL;
  		}
--- 634,647 ----
  		procheader("");
  		strcpy(Pathname, *argp);
  		if (!(fout = our_fopen(Pathname, "w")))
  		{
! 			sprintf(s128, "%-0.64s: %-0.40s", Pathname,
! #ifdef __FreeBSD__
! 				strerror(errno));
! #else
! 				sys_errlist[errno]);
! #endif
  			report_str(s128, 1);
  			ecu_log_event(getppid(), s128);
  			goto FAIL;
  		}
***************
*** 1334,1345 ****
  			fout = our_fopen(name, openmode);
  	}
  	if (!fout)
  	{
  		if (errno > sys_nerr)
  			sprintf(s128, "%-0.64s: open errno %d", name, errno);
  		else
! 			sprintf(s128, "%-0.64s: open error: %s", name, sys_errlist[errno]);
  		ecu_log_event(getppid(), s128);
  		skip_count++;
  		report_error_count();
  		return (ERROR);
--- 1346,1364 ----
  			fout = our_fopen(name, openmode);
  	}
  	if (!fout)
  	{
+ #ifndef __FreeBSD__
  		if (errno > sys_nerr)
  			sprintf(s128, "%-0.64s: open errno %d", name, errno);
  		else
! #endif
! 			sprintf(s128, "%-0.64s: open error: %s", name,
! #ifdef __FreeBSD__
! 				strerror(errno));
! #else
! 				sys_errlist[errno]);
! #endif
  		ecu_log_event(getppid(), s128);
  		skip_count++;
  		report_error_count();
  		return (ERROR);
***************
*** 1347,1358 ****
  	if (fseek(fout, rxfilepos, 0))
  	{
  		fclose(fout);
  		fout = (FILE *) 0;
  		if (errno > sys_nerr)
  			sprintf(s128, "%-0.64s: seek errno %d", name, errno);
  		else
! 			sprintf(s128, "%-0.64s: seek error: %s", name, sys_errlist[errno]);
  		ecu_log_event(getppid(), s128);
  		skip_count++;
  		report_error_count();
  		return (ERROR);
--- 1366,1384 ----
  	if (fseek(fout, rxfilepos, 0))
  	{
  		fclose(fout);
  		fout = (FILE *) 0;
+ #ifndef __FreeBSD__
  		if (errno > sys_nerr)
  			sprintf(s128, "%-0.64s: seek errno %d", name, errno);
  		else
! #endif
! 			sprintf(s128, "%-0.64s: seek error: %s", name,
! #ifdef __FreeBSD__
! 				strerror(errno));
! #else
! 				sys_errlist[errno]);
! #endif
  		ecu_log_event(getppid(), s128);
  		skip_count++;
  		report_error_count();
  		return (ERROR);
***************
*** 1442,1449 ****
--- 1468,1476 ----
  		zshhdr(tryzhdrtype, Txhdr);
  		if (tryzhdrtype == ZSKIP)	/* Don't skip too far */
  			tryzhdrtype = ZRINIT;	/* CAF 8-21-87 */
  	  again:
+ 		report_rx_tx_count();    /* which will do a refresh */
  		switch (zgethdr(Rxhdr, 0))
  		{
  			case ZRQINIT:
  				continue;
***************
*** 1760,1771 ****
  
  	report_file_close(0);
  	if (fclose(fout) == ERROR)
  	{
  		if (errno > sys_nerr)
  			sprintf(s128, "finish close errno %d", errno);
  		else
! 			sprintf(s128, "finish close error: %s", sys_errlist[errno]);
  		ecu_log_event(getppid(), s128);
  		fout = (FILE *) 0;
  		return (ERROR);
  	}
--- 1787,1805 ----
  
  	report_file_close(0);
  	if (fclose(fout) == ERROR)
  	{
+ #ifndef __FreeBSD__
  		if (errno > sys_nerr)
  			sprintf(s128, "finish close errno %d", errno);
  		else
! #endif
! 			sprintf(s128, "finish close error: %s",
! #ifdef __FreeBSD__
! 				strerror(errno));
! #else
! 				sys_errlist[errno]);
! #endif
  		ecu_log_event(getppid(), s128);
  		fout = (FILE *) 0;
  		return (ERROR);
  	}
*** ../ecu-3.32/z/ecusz.c	Mon May 23 14:46:03 1994
--- z/ecusz.c	Sun Jan 15 02:21:11 1995
***************
*** 66,73 ****
--- 66,76 ----
  	zsendfile(buf,blen)
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-15-1995-01:52-wht@n4hgf-clean up creeping port rot */
+ /*:01-15-1995-00:51-wht@n4hgf-unsigned & signed ptr conflicts w/FreeBSD gcc */
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:04-01-1994-20:56-wht@n4hgf-pedantic what-compatible version */
  /*:02-16-1993-13:14-wht@n4hgf-make Baudrate long for 286 */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
***************
*** 106,117 ****
--- 109,125 ----
  #include <setjmp.h>
  #include <ctype.h>
  #include <string.h>
  #include <fcntl.h>
+ #ifdef __FreeBSD__
+ #include <unistd.h>
+ #endif
  #include "zmodem.h"
  #include <sys/param.h>
  
+ #ifndef __FreeBSD__
  extern char *sys_errlist[];
+ #endif
  extern unsigned short crctab[];	/* wht */
  extern unsigned long total_data_bytes_xfered;	/* zcurses.c */
  extern int errno;
  extern int show_window;
***************
*** 160,168 ****
  char Lzmanag;				 /* Local ZMODEM file management request */
  char Lztrans;
  char Pathname[PATHLEN];
  char curr_dir[256];
! char txbuf[1024];
  char zconv;					 /* ZMODEM file conversion request */
  char zmanag;				 /* ZMODEM file management request */
  char ztrans;				 /* ZMODEM file transport request */
  int Ascii;					 /* Add CR's for brain damaged programs */
--- 168,176 ----
  char Lzmanag;				 /* Local ZMODEM file management request */
  char Lztrans;
  char Pathname[PATHLEN];
  char curr_dir[256];
! unsigned char txbuf[1024];
  char zconv;					 /* ZMODEM file conversion request */
  char zmanag;				 /* ZMODEM file management request */
  char ztrans;				 /* ZMODEM file transport request */
  int Ascii;					 /* Add CR's for brain damaged programs */
***************
*** 512,520 ****
  --------------------------------------------------------------------------*/
  void
  flushline()
  {
! #if defined(sun)
  	int retries = 50;
  	int outq_count;
  	int old_outq_count = 0;
  
--- 520,528 ----
  --------------------------------------------------------------------------*/
  void
  flushline()
  {
! #if defined(sun) || defined(__FreeBSD__)
  	int retries = 50;
  	int outq_count;
  	int old_outq_count = 0;
  
***************
*** 527,535 ****
  	fflush(iofp);
  #endif
  
  #if defined(CFG_TermiosLineio)
! #if defined(sun)
  	do
  	{
  		ioctl(iofd, TIOCOUTQ, &outq_count);
  		if (!outq_count)
--- 535,543 ----
  	fflush(iofp);
  #endif
  
  #if defined(CFG_TermiosLineio)
! #if defined(sun) || defined(__FreeBSD__)
  	do
  	{
  		ioctl(iofd, TIOCOUTQ, &outq_count);
  		if (!outq_count)
***************
*** 860,867 ****
--- 868,876 ----
  		saybibi();
  	else if (!Xmodem)
  		wctxpn("");
  	return (OK);
+ 
  }
  
  /*+-------------------------------------------------------------------------
  	wcs(oname) -- send a file
***************
*** 876,884 ****
  	strcpy(Pathname, oname); /* global copy of name */
  
  	if ((in = fopen(oname, "r")) == NULL)
  	{
! 		sprintf(s128, "SEND %s: %s", sys_errlist[errno], oname);
  #if defined(LOG_XFER)
  		ecu_log_event(getppid(), s128);
  #endif
  		report_str(s128 + 5, 1);
--- 885,898 ----
  	strcpy(Pathname, oname); /* global copy of name */
  
  	if ((in = fopen(oname, "r")) == NULL)
  	{
! 		sprintf(s128, "SEND %s: %s", oname,
! #ifdef __FreeBSD__
! 			strerror(errno));
! #else
! 			sys_errlist[errno]);
! #endif
  #if defined(LOG_XFER)
  		ecu_log_event(getppid(), s128);
  #endif
  		report_str(s128 + 5, 1);
***************
*** 947,955 ****
  int
  wctxpn(name)
  char *name;
  {
! 	register char *p, *q;
  	char name2[PATHLEN];
  	struct stat f;
  
  	if (Xmodem)
--- 961,969 ----
  int
  wctxpn(name)
  char *name;
  {
! 	register unsigned char *p, *q;
  	char name2[PATHLEN];
  	struct stat f;
  
  	if (Xmodem)
***************
*** 973,984 ****
  			return (ERROR);
  		}
  	}
  
! 	q = (char *)0;
  	if (Dottoslash)
! 	{						 /* change . to . */
! 		for (p = name; *p; ++p)
  		{
  			if (*p == '/')
  				q = p;
  			else if (*p == '.')
--- 987,998 ----
  			return (ERROR);
  		}
  	}
  
! 	q = 0;
  	if (Dottoslash)
! 	{						 /* change / to . */
! 		for (p = (unsigned char *)name; *p; ++p)
  		{
  			if (*p == '/')
  				q = p;
  			else if (*p == '.')
***************
*** 988,1010 ****
  		{					 /* If name>8 chars */
  			q += 8;			 /* make it .ext */
  			strcpy(name2, q);/* save excess of name */
  			*q = '.';
! 			strcpy(++q, name2);	/* add it back */
  		}
  	}
  
! 	for (p = name, q = txbuf; *p;)
  		if ((*q++ = *p++) == '/' && !Fullname)
  			q = txbuf;
  	*q++ = 0;
  	p = q;
  	while (q < (txbuf + 1024))
  		*q++ = 0;
  	if (!Ascii && (in != stdin) && *name && !fstat(fileno(in), &f))
  		sprintf(p, "%lu %lo %o 0 %d %ld", f.st_size, f.st_mtime,
! 			f.st_mode &= ~(S_ISUID | S_ISGID),
! 			Filesleft, TotalLeft);
  	report_xfer_mode((Lzconv == ZCNL) ? "ASCII" : "BINARY");
  	TotalLeft -= f.st_size;
  	if (--Filesleft <= 0)
  		TotalLeft = 0;
--- 1002,1026 ----
  		{					 /* If name>8 chars */
  			q += 8;			 /* make it .ext */
  			strcpy(name2, q);/* save excess of name */
  			*q = '.';
! 			strcpy((char *)++q, name2);	/* add it back */
  		}
  	}
  
! 	for (p = (unsigned char *)name, q = txbuf; *p;)
  		if ((*q++ = *p++) == '/' && !Fullname)
  			q = txbuf;
  	*q++ = 0;
  	p = q;
  	while (q < (txbuf + 1024))
  		*q++ = 0;
  	if (!Ascii && (in != stdin) && *name && !fstat(fileno(in), &f))
+ 	{
+ 		f.st_mode &= ~(S_ISUID | S_ISGID);
  		sprintf(p, "%lu %lo %o 0 %d %ld", f.st_size, f.st_mtime,
! 			f.st_mode, Filesleft, TotalLeft);
! 	}
  	report_xfer_mode((Lzconv == ZCNL) ? "ASCII" : "BINARY");
  	TotalLeft -= f.st_size;
  	if (--Filesleft <= 0)
  		TotalLeft = 0;
***************
*** 1263,1275 ****
  	xbuf_build(buf,count)
    fill buf with count chars padding with ^Z for CPM and DOS
  --------------------------------------------------------------------------*/
  xbuf_build(buf, count)
! register char *buf;
  int count;
  {
  	register c, m;
  	long lseek();
  	long X_txpos = lseek(fileno(in), 0L, 1);
  	char diag_str[64];
  
  	report_send_progress(X_txpos);
--- 1279,1293 ----
  	xbuf_build(buf,count)
    fill buf with count chars padding with ^Z for CPM and DOS
  --------------------------------------------------------------------------*/
  xbuf_build(buf, count)
! register unsigned char *buf;
  int count;
  {
  	register c, m;
+ #ifndef __FreeBSD__
  	long lseek();
+ #endif
  	long X_txpos = lseek(fileno(in), 0L, 1);
  	char diag_str[64];
  
  	report_send_progress(X_txpos);
***************
*** 1604,1612 ****
  /*+-------------------------------------------------------------------------
  	zsendfile(buf,blen) - send file name & info
  --------------------------------------------------------------------------*/
  zsendfile(buf, blen)
! char *buf;
  int blen;
  {
  	register c;
  
--- 1622,1630 ----
  /*+-------------------------------------------------------------------------
  	zsendfile(buf,blen) - send file name & info
  --------------------------------------------------------------------------*/
  zsendfile(buf, blen)
! unsigned char *buf;
  int blen;
  {
  	register c;
  
*** ../ecu-3.32/z/zcommon.c	Wed May  4 04:40:15 1994
--- z/zcommon.c	Mon Feb 13 16:25:19 1995
***************
*** 14,21 ****
--- 14,22 ----
  	zmputs(str)
  
  --------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:11-23-1993-10:48-wht@n4hgf-hpux */
  /*:02-16-1993-13:14-wht@n4hgf-make Baudrate long for 286 */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
***************
*** 116,123 ****
--- 117,136 ----
  		38400, B38400
  	}
  	,
  #endif
+ #ifdef B57600
+ 	{
+ 		57600, B57600
+ 	}
+ 	,
+ #endif
+ #ifdef B115200
+ 	{
+ 		115200, B115200
+ 	}
+ 	,
+ #endif
  	{
  		0, 0
  	}
  };
***************
*** 265,273 ****
  	0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
  	0x2d02ef8dL
  };
  
! unsigned short
  getspeed(atty)
  struct termio *atty;
  {
  	register n;
--- 278,286 ----
  	0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
  	0x2d02ef8dL
  };
  
! unsigned
  getspeed(atty)
  struct termio *atty;
  {
  	register n;
***************
*** 277,285 ****
--- 290,302 ----
  	{
  		if (speeds[n].speedcode == code)
  			return (speeds[n].baudr);
  	}
+ #ifdef B115200
+ 	return (115200);
+ #else
  	return (38400);			 /* Assume fifo if ioctl failed */
+ #endif
  }
  
  /*
   * mode(n)
*** ../ecu-3.32/z/zcurses.c	Wed May  4 04:40:16 1994
--- z/zcurses.c	Fri Feb 17 14:28:12 1995
***************
*** 9,17 ****
  03|  File position:  _8______ length: _8______  -rwxrwxrwx   |
  04|  _55____________________________________________________ | transaction
  05|  _55____________________________________________________ | last rx/tx hdr
  06|  Comm I/O: rx _8______  tx _8______ bytes                |
! 07|  Baud rate: _5___ BINARY blklen: _____ comm mode: RAW-g  |
  08|  Time:    started: __:__:__ this file: __:__:__ window:  |
  09|  __:__:__ elapsed: __:__:__            __:__:__ ________ |
  10|  Errors: this file: _3_ total: _4__ files skipped: _3_   |
  11|  _55____________________________________________________ |  err str
--- 9,17 ----
  03|  File position:  _8______ length: _8______  -rwxrwxrwx   |
  04|  _55____________________________________________________ | transaction
  05|  _55____________________________________________________ | last rx/tx hdr
  06|  Comm I/O: rx _8______  tx _8______ bytes                |
! 07|  Baudrate: _6____ BINARY blklen: _____ comm mode: RAW-g  |
  08|  Time:    started: __:__:__ this file: __:__:__ window:  |
  09|  __:__:__ elapsed: __:__:__            __:__:__ ________ |
  10|  Errors: this file: _3_ total: _4__ files skipped: _3_   |
  11|  _55____________________________________________________ |  err str
***************
*** 64,75 ****
  	report_txpos(pos)
  	report_uninit(sig)
  	report_window()
  	report_xfer_mode(str)
- 	vanilla_ruling()
  
  ------------------------------------------------------------------------*/
  /*+:EDITS:*/
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:01-16-1994-15:46-wht@n4hgf-use ecumachdep.h */
  /*:12-02-1993-14:05-Robert_Broughton@mindlink.bc.c-LINUX patches */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
--- 64,78 ----
  	report_txpos(pos)
  	report_uninit(sig)
  	report_window()
  	report_xfer_mode(str)
  
  ------------------------------------------------------------------------*/
  /*+:EDITS:*/
+ /*:02-17-1995-14:21-wht@n4hgf-apply Andrew Chernov to last 3.33 prerelease */
+ /*:01-15-1995-01:20-wht@n4hgf-clean up creeping port rot */
+ /*:01-15-1995-00:53-wht@n4hgf-need sys/ioctl.h for FreeBSD */
+ /*:01-12-1995-15:20-wht@n4hgf-apply Andrew Chernov 8-bit clean+FreeBSD patch */
  /*:05-04-1994-04:40-wht@n4hgf-ECU release 3.30 */
  /*:01-16-1994-15:46-wht@n4hgf-use ecumachdep.h */
  /*:12-02-1993-14:05-Robert_Broughton@mindlink.bc.c-LINUX patches */
  /*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
***************
*** 97,141 ****
  #include "../ecu_stat.h"
  #include "../ecu_time.h"
  #include <ctype.h>
  #include <signal.h>
! 
! #include "../ecumachdep.h"
! #include "../pc_scr.h"
  
  #if defined(FASI)
  #include <local/fas.h>
  #endif /* FASI */
  
  long time();
  void report_error_count();
  extern char *tzname[];
  struct tm *localtime();
  
! #ifdef LINUX
! typedef chtype Chtype;
! 
  #else
! typedef unsigned char Chtype;
  
  #endif
  
! Chtype sTL = at_TL;
! Chtype sTR = at_TR;
! Chtype sBL = at_BL;
! Chtype sBR = at_BR;
! Chtype sLT = at_LT;
! Chtype sRT = at_RT;
! Chtype sVR = at_VR;
! Chtype sHR = at_HR;
! 
  #if defined(FASI)
! #define WIN_LINES	18
  #else
! #if defined(sun) && !defined (SVR4)
  #define WIN_LINES	17
  #else
  #define WIN_LINES	15
  #endif /* sun */
  #endif /* FASI */
  
  #define WIN_COLS	60
--- 100,162 ----
  #include "../ecu_stat.h"
  #include "../ecu_time.h"
  #include <ctype.h>
  #include <signal.h>
! #if defined(__FreeBSD__)
! #include <sys/ioctl.h>
! #endif
  
  #if defined(FASI)
  #include <local/fas.h>
  #endif /* FASI */
  
+ #if (defined(sun) && !defined(SVR4)) && !defined(SunOS)
+ #define SunOS
+ #endif
+ 
  long time();
  void report_error_count();
  extern char *tzname[];
  struct tm *localtime();
  
! #if defined(LINUX) || defined(__FreeBSD__)
! #define sTL ACS_ULCORNER
! #define sTR ACS_URCORNER
! #define sBL ACS_LLCORNER
! #define sBR ACS_LRCORNER
! #define sLT ACS_LTEE
! #define sRT ACS_RTEE
! #define sVR ACS_VLINE
! #define sHR ACS_HLINE
  #else
! #include "../pc_scr.h"
  
+ #define sTL vanilla_TL
+ #define sTR vanilla_TR
+ #define sBL vanilla_BL
+ #define sBR vanilla_BR
+ #define sLT vanilla_LT
+ #define sRT vanilla_RT
+ #define sVR vanilla_VR
+ #define sHR vanilla_HR
  #endif
  
! /*
!  * define window geometry
!  *   varying number of lines depending on sys-dependent driver stats
!  *   other values fixed
!  */
  #if defined(FASI)
! #define WIN_LINES	18 /* FASI stats */
  #else
! #if defined(SunOS)
! #define WIN_LINES	17
! #else
! #if defined(__FreeBSD__)
  #define WIN_LINES	17
  #else
  #define WIN_LINES	15
+ #endif /* FreeBSD */
  #endif /* sun */
  #endif /* FASI */
  
  #define WIN_COLS	60
***************
*** 191,235 ****
  	"  File position:  ________ length: ________               ",	/* 3 */
  	"                                                          ",	/* 4 */
  	"  tx: ______________________  rx: ______________________  ",	/* 5 */
  	"  Comm I/O: rx ________  tx ________ bytes                ",	/* 6 */
! 	"  Baud rate: _____ ______ blklen: _____ comm mode: ______ ",	/* 7 */
  	"  Time:    started: __:__:__ this file: __:__:__          ",	/* 8 */
  	"  __:__:__ elapsed: __:__:__            __:__:__          ",	/* 9 */
  	"  Errors: this file: ___ total: ____ files skipped: ___   ",	/* 10 */
  	"                                                          ",	/* 11 */
  	"                                                          ",	/* 12 */
  	"                                                          ",	/* 13 */
  #if defined(FASI)
! 	"  FE ___ OE ___ rcvd ________ xmtd ________ RTS _ CTS _   ",
! 	"  flow xmtr CTS ____ XOFF ____ rcvr RTS ____ XOFF ____    ",
! 	"  queues: xmtr _____ of _____  rcvr _____ of _____        ",
  #endif /* FASI */
! #if defined(sun)
! 	"  Output queue depth  ______  RTS _  CTS _                ",
! 	"  Input queue depth   ______  Input queue avail ______    ",
  #endif
  /*`----------------------------------------------------------' */
  	(char *)0
  };
  
- /*+-------------------------------------------------------------------------
- 	vanilla_ruling() - use ordinary ruling characters
- --------------------------------------------------------------------------*/
- void
- vanilla_ruling()
- {
- 	sTL = vanilla_TL;
- 	sTR = vanilla_TR;
- 	sBL = vanilla_BL;
- 	sBR = vanilla_BR;
- 	sLT = vanilla_LT;
- 	sRT = vanilla_RT;
- 	sVR = vanilla_VR;
- 	sHR = vanilla_HR;
- 
- }							 /* end of vanilla_ruling */
- 
  /*+-----------------------------------------------------------------------
  	char *get_elapsed_time(elapsed_secs)
  	hh:mm:ss returned
    static string address is returned
--- 212,244 ----
  	"  File position:  ________ length: ________               ",	/* 3 */
  	"                                                          ",	/* 4 */
  	"  tx: ______________________  rx: ______________________  ",	/* 5 */
  	"  Comm I/O: rx ________  tx ________ bytes                ",	/* 6 */
! 	"  Baudrate: ______ ______ blklen: _____ comm mode: ______ ",   /* 7 */
  	"  Time:    started: __:__:__ this file: __:__:__          ",	/* 8 */
  	"  __:__:__ elapsed: __:__:__            __:__:__          ",	/* 9 */
  	"  Errors: this file: ___ total: ____ files skipped: ___   ",	/* 10 */
  	"                                                          ",	/* 11 */
  	"                                                          ",	/* 12 */
  	"                                                          ",	/* 13 */
  #if defined(FASI)
! 	"  FE ___ OE ___ rcvd ________ xmtd ________ RTS _ CTS _   ",	/* 14 */
! 	"  flow xmtr CTS ____ XOFF ____ rcvr RTS ____ XOFF ____    ",	/* 15 */
! 	"  queues: xmtr _____ of _____  rcvr _____ of _____        ",	/* 16 */
  #endif /* FASI */
! #if defined(SunOS)
! 	"  Output queue depth  ______  RTS _  CTS _                ",	/* 14 */
! 	"  Input queue depth   ______  Input queue avail ______    ",	/* 15 */
! 	"  Input queue avail   ______                              ",	/* 16 */
! #endif
! #if defined(__FreeBSD__)
! 	"  Output queue depth  ______  RTS _  CTS _                ",	/* 14 */
! 	"  Input queue avail   ______                              ",	/* 1 */
  #endif
  /*`----------------------------------------------------------' */
  	(char *)0
  };
  
  /*+-----------------------------------------------------------------------
  	char *get_elapsed_time(elapsed_secs)
  	hh:mm:ss returned
    static string address is returned
***************
*** 610,621 ****
  --------------------------------------------------------------------------*/
  int
  determine_output_mode()
  {
- #if defined(CONS_GET)
- 	int monitor_type;
- 
- #endif
  	struct stat dn;
  	struct stat tty_stat;
  
  #ifdef NO_PTY_CURSES
--- 619,626 ----
***************
*** 630,707 ****
  		report_init_complete = 1;
  		return (1);
  	}
  
! #ifndef M_SYSV				 /* these are always set thus for non-SCO */
! 	vanilla_ruling();
! #endif
! 
! #if defined(CONS_GET)
! 	if (ioctl(0, CONS_GET, &monitor_type) < 0)	/* not multiscreen */
  	{
- #endif
- 
- #ifdef M_SYSV				 /* SCO non AT console */
- 		vanilla_ruling();
- #endif
- #ifdef LINUX
- 		sTL = ACS_ULCORNER;
- 		sTR = ACS_URCORNER;
- 		sBL = ACS_LLCORNER;
- 		sBR = ACS_LRCORNER;
- 		sLT = ACS_LTEE;
- 		sRT = ACS_RTEE;
- 		sVR = ACS_VLINE;
- 		sHR = ACS_HLINE;
- #endif
- 
- 		/*
- 		 * if tty (console) is not character special, only report basic
- 		 * progress
- 		 */
- 		memset((char *)&dn, 0, sizeof(dn));
- 		stat("/dev/null", &dn);
- 		if (fstat(0, &tty_stat) ||
- 			((tty_stat.st_mode & S_IFMT) != S_IFCHR) ||
- 			(dn.st_rdev == tty_stat.st_rdev))
- 		{
  #ifndef LINUX
! 			dumbtty = 1;
! #endif
! 			report_verbosity = 0;
! 			report_init_complete = 1;
! 			return (1);
! 		}
! 
! #ifdef NO_PTY_CURSES
! 
! 		/*
! 		 * if pty (must be xterm), send clear screen and no curses
! 		 */
! 		if (!stat("/dev/ttyp0", &pty_stat) &&
! 			(pty_stat.st_rdev & 0xFF00) == (tty_stat.st_rdev & 0xFF00))
! 		{
! 			static char ff[] = "\033[H\0332J\r\n";
! 
! 			write(2, ff, strlen(ff));
! 			dumbtty = 1;
! 			report_verbosity = 1;
! 			report_init_complete = 1;
! 			return (1);
! 		}
  #endif
  
! 		/*
! 		 * if non-multiscreen tty baud rate not at least that of the
! 		 * attached line, use no curses, but do be a bit more verbose than
! 		 * if tty not char special
! 		 */
  #ifdef TTY_VS_LINE_SPEED_NO_CURSES
! 		test_tty_and_line_baud();
! #endif
! 
! #if defined(CONS_GET)
! 	}
  #endif
  
  	return (dumbtty);
  
--- 635,667 ----
  		report_init_complete = 1;
  		return (1);
  	}
  
! 	/*
! 	 * if tty (console) is not character special, only report basic
! 	 * progress
! 	 */
! 	memset((char *)&dn, 0, sizeof(dn));
! 	stat("/dev/null", &dn);
! 	if (fstat(0, &tty_stat) ||
! 		((tty_stat.st_mode & S_IFMT) != S_IFCHR) ||
! 		(dn.st_rdev == tty_stat.st_rdev))
  	{
  #ifndef LINUX
! 		dumbtty = 1;
  #endif
+ 		report_verbosity = 0;
+ 		report_init_complete = 1;
+ 		return (1);
+ 	}
  
! 	/*
! 	 * if non-multiscreen tty baud rate not at least that of the
! 	 * attached line, use no curses, but do be a bit more verbose than
! 	 * if tty not char special
! 	 */
  #ifdef TTY_VS_LINE_SPEED_NO_CURSES
! 	test_tty_and_line_baud();
  #endif
  
  	return (dumbtty);
  
***************
*** 744,752 ****
  	clear();
  	report_init_complete = 1;
  	win = newwin(WIN_LINES, WIN_COLS, WIN_TOPY, WIN_LEFTX);
  	box(win, sVR, sHR);
! #if !defined(SVR4) && !defined(LINUX)
  	wmove(win, 0, 0);
  	waddch(win, sTL);
  	wmove(win, win->_maxy - 1, 0);
  	waddch(win, sBL);
--- 704,712 ----
  	clear();
  	report_init_complete = 1;
  	win = newwin(WIN_LINES, WIN_COLS, WIN_TOPY, WIN_LEFTX);
  	box(win, sVR, sHR);
! #ifndef __FreeBSD__
  	wmove(win, 0, 0);
  	waddch(win, sTL);
  	wmove(win, win->_maxy - 1, 0);
  	waddch(win, sBL);
***************
*** 767,775 ****
  #ifdef SVR4
  	whline(win, (unsigned long)(sHR & 0x00ff), 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
! #ifdef LINUX
  	whline(win, sHR, 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
  	waddch(win, sHR);
--- 727,735 ----
  #ifdef SVR4
  	whline(win, (unsigned long)(sHR & 0x00ff), 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
! #if defined(LINUX) || defined(__FreeBSD__)
  	whline(win, sHR, 2);
  	wmove(win, 0, 8 + strlen(title));
  #else
  	waddch(win, sHR);
***************
*** 979,992 ****
  	unsigned long ltmp;
  	struct fas_info now;
  
  #endif /* FASI */
! #if defined(sun) && !defined (SVR4)
  	uint output_queue;
  	uint input_avail;
  	uint input_size;
- 	uint modem_lines;
- 
  #endif
  
  	register char *cptr;
  
--- 939,953 ----
  	unsigned long ltmp;
  	struct fas_info now;
  
  #endif /* FASI */
! #if defined(SunOS) || defined(__FreeBSD__)
  	uint output_queue;
+ 	uint modem_lines;
  	uint input_avail;
+ #endif
+ #if defined(SunOS)
  	uint input_size;
  #endif
  
  	register char *cptr;
  
***************
*** 1110,1118 ****
  		}
  	}
  #endif /* FASI */
  
! #if defined(sun) && !defined (SVR4)
  	output_queue = 0;
  	ioctl(iofd, TIOCOUTQ, (int *)&output_queue);
  	if (output_queue > 999999)
  		output_queue = 999999;
--- 1071,1079 ----
  		}
  	}
  #endif /* FASI */
  
! #if defined(SunOS) || defined(__FreeBSD__)
  	output_queue = 0;
  	ioctl(iofd, TIOCOUTQ, (int *)&output_queue);
  	if (output_queue > 999999)
  		output_queue = 999999;
***************
*** 1125,1147 ****
  	wmove(win, 14, 35);
  	waddch(win, (modem_lines & TIOCM_RTS) ? 'T' : 'F');
  	wmove(win, 14, 42);
  	waddch(win, (modem_lines & TIOCM_CTS) ? 'T' : 'F');
! 
  	input_size = 0;
  	input_avail = 0;
  	ioctl(iofd, TIOCISPACE, (int *)&input_avail);
  	ioctl(iofd, TIOCISIZE, (int *)&input_size);
  	if (input_size > 999999)
  		input_size = 999999;
  	if (input_avail > 999999)
  		input_avail = 999999;
  	sprintf(s128, "%6u", input_size - input_avail);
  	wmove(win, 15, 23);
  	waddstr(win, s128);
  	sprintf(s128, "%6u", input_avail);
  	wmove(win, 15, 49);
  	waddstr(win, s128);
  #endif
  
  	report_window();
  
--- 1086,1119 ----
  	wmove(win, 14, 35);
  	waddch(win, (modem_lines & TIOCM_RTS) ? 'T' : 'F');
  	wmove(win, 14, 42);
  	waddch(win, (modem_lines & TIOCM_CTS) ? 'T' : 'F');
! #ifndef __FreeBSD__
  	input_size = 0;
+ #endif
  	input_avail = 0;
+ #ifndef __FreeBSD__
  	ioctl(iofd, TIOCISPACE, (int *)&input_avail);
  	ioctl(iofd, TIOCISIZE, (int *)&input_size);
  	if (input_size > 999999)
  		input_size = 999999;
+ #else
+ 	ioctl(iofd, FIONREAD, (int *)&input_avail);
+ #endif
  	if (input_avail > 999999)
  		input_avail = 999999;
+ #ifndef __FreeBSD__
  	sprintf(s128, "%6u", input_size - input_avail);
  	wmove(win, 15, 23);
  	waddstr(win, s128);
  	sprintf(s128, "%6u", input_avail);
  	wmove(win, 15, 49);
  	waddstr(win, s128);
+ #else
+ 	sprintf(s128, "%6u", input_avail);
+ 	wmove(win, 15, 23);
+ 	waddstr(win, s128);
+ #endif
  #endif
  
  	report_window();
  
***************
*** 1310,1324 ****
  			wrefresh(win);
  		}
  	}
  
! 	if ((filepos > 99999999L) || (filepos < 0L))
! 		return;
! 
! 	sprintf(s128, "%-8lu", filepos);
! 	wmove(win, 3, 19);
! 	waddstr(win, s128);
! 	report_file_xfer_rate("data", filepos - initfpos, 0);
  	report_rx_tx_count();	 /* which will do a refresh */
  
  }							 /* end of report_transfer_progress */
  
--- 1282,1295 ----
  			wrefresh(win);
  		}
  	}
  
! 	if (filepos <= 99999999L && filepos >= 0L) {
! 		sprintf(s128, "%-8lu", filepos);
! 		wmove(win, 3, 19);
! 		waddstr(win, s128);
! 		report_file_xfer_rate("data", filepos - initfpos, 0);
! 	}
  	report_rx_tx_count();	 /* which will do a refresh */
  
  }							 /* end of report_transfer_progress */
  
***************
*** 1820,1828 ****
  
  /*+-------------------------------------------------------------------------
  	report_comm_baud_rate(baud_rate)
  
!  baud rate: row 7 col 14 length 5
  --------------------------------------------------------------------------*/
  report_comm_baud_rate(baud_rate)
  unsigned int baud_rate;
  {
--- 1791,1799 ----
  
  /*+-------------------------------------------------------------------------
  	report_comm_baud_rate(baud_rate)
  
!  baud rate: row 7 col 13 length 6
  --------------------------------------------------------------------------*/
  report_comm_baud_rate(baud_rate)
  unsigned int baud_rate;
  {
***************
*** 1834,1847 ****
  	{
  		return;
  	}
  
! 	clear_area(win, 7, 14, 5);
  	if (baud_rate == 0)
  		waddstr(win, "?");
  	else
  	{
! 		sprintf(tstr8, "%-5u", baud_rate);
  		waddstr(win, tstr8);
  	}
  	wrefresh(win);
  
--- 1805,1818 ----
  	{
  		return;
  	}
  
! 	clear_area(win, 7, 13, 6);
  	if (baud_rate == 0)
  		waddstr(win, "?");
  	else
  	{
! 		sprintf(tstr8, "%-6u", baud_rate);
  		waddstr(win, tstr8);
  	}
  	wrefresh(win);
  

exit 0 # Just in case...

