🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Stan Barber Mon, 16 Apr 1990 20:32
REPOST: RN Patch #45
#516
Author: Stan Barber
Date: Mon, 16 Apr 1990 20:32
2595 lines
71687 bytes
A number of people have pointed out that the final.c in the original posting
of the patch did not work. This is now fixed. If you got the previous patch
and it worked, ignore this posting. Patch 46 is already in the queue to address
some problems of this patch and some functionality I could not cram into this
one.
----------------------------------------------------------------------------
Description:
This is patch 45 for rn/rrn. You must have installed patches prior to 45
for these patches to work sucessfully.

You can obtain patches 1-40 from Larry Wall. Patches 41 and up are on the host
bcm.tmc.edu in the public directory. You can also retrieve them via mail.
Send mail to "archive-server@bcm.tmc.edu" with text in the message that looks
like:

send public rn.XX.patch 

where XX is the patch number you want. Remember, only patches 41 and up are
available from this resource at this time.

You can pick up the fully patched kit from lib.tmc.edu [129.106.5.1] in the
directory public/rn.

The following bugs are addressed in this kit:

The copy of the active file in the /tmp directory was not removed on exit.
    Reported by nagel@ics.uci.edu, eggert@twinsun.com (Paul Eggert),
    Felix Lee <flee@shire.cs.psu.edu> and others.

Configure could not determine when it was on a 386i.
    Reported by jim@eda.com and isaak!luik@uunet.uu.net.

The size of ACT_POS has been changed from short to long to cope with the ever
increasing size of the active file.
    Reported by jthomp@wintermute.Eng.Sun.COM (Jim Thompson),  Antti Louko
    <alo@kampi.hut.fi>, and eps@cs.SFSU.EDU.

Searches attempted when no search pattern has been specified cause a 
segmentation violation.
    Reported by Jordan Brown <seas.ucla.edu!lcc!jbrown> and others.

Cancel messages were failing because the user id of the news administrator
was never being determined correctly. 
    Reported by Chip Rosenthal <chip@chinacat.lonestar.org>

Configure would not work right under System V in determining if termio
is supposed to be used or not.
    Reported by many many people.

If a LIST command fails because of a bad network connection, rn would some-
times continue to operate with the truncated active file and declare groups
invalid
    Reported by stewart@netxcom.iad-nxe.global-mis.dhl.com (John Stewart)

Reworked signal handling code to better handle signals (I hope!).
    Reported by Adri Verhoef <rivm!a3@relay.eu.net> and others.

Two spots in the backpage code (art.c & ng.c) would decrement artline past
the lower limit (-1) if 'b' is hit at the top of an article.
    Reported by Wayne Davison <drivax!davison>

The header of an article was incorrectly thought to be ended if	rn encounters
a header longer than the longest header rn considers legal.  This limit can
be easily exceeded with the X- headers.
    Reported by Wayne Davison <drivax!davison>

The lock-checking code called 'finalize(0)' if it detected that rn was
currently running.  Unfortunately, finalize removes the lock file, which
would allow another rn to run if you simply try again.
    Reported by Wayne Davison <drivax!davison>

The kill file code was slightly bogus for entering a newsgroup with terse set.
ng.c calls the code with a terse version of the entering message, but it is
never output. This patch causes the terse entering message to be output, while
continuing to skip the (non-tersed) exiting message.  The code is also
enhanced to not pause in verbose mode when no actual kills are performed,
and to pause briefly in tersemode when kills ARE performed.
    Reported by Wayne Davison <drivax!davison>

An error message in rrn printed out "filexp(ACTIVE)" rather than the name we
looked up for the active file (active_name).
    Reported by Wayne Davison <drivax!davison>

Using the Q command to exit a newsgroup to the current newsgroup prompt would
not update the article count to the current value.
    Reported by Wayne Davison <drivax!davison>

Enhancements added with this kit:

SCO Xenix has a function that works much like FIONREAD called rdchk(). Support
has been added for this.
    Reported by ronald@robobar.co.uk

Added support for the active file flags in CNEWS. Some might consider this an
enhancement, others a bug....I don't intend to argue.
    Reported by tale@turing.cs.rpi.edu (David C Lawrence)

Configure now knows about HP-UX and Silicon Graphics IRIX varients.
    Suggested by tml@hemuli.atk.vtt.fi.

Fix:
	cd to your rn source directory and patch away

Index: patchlevel
Prereq: 44
*** patchlevel	Mon Feb  2 17:24:23 1987
--- ../rn/patchlevel	Mon Nov  6 00:51:21 1989
***************
*** 1
! Patch #: 44

--- 1 -----
! Patch #: 45
Index: Configure
Prereq: 4.3.2.15
*** Configure	Sun Apr 15 02:32:00 1990
--- ../rn/Configure	Sun Apr 15 02:54:16 1990
***************
*** 1,11 ****
! #! /bin/sh
  #
  # If these # comments don't work, trim them.  Don't worry about the other
  # shell scripts, Configure will trim # comments from them for you.
  #
! # $Header: Configure,v 4.3.2.15 89/12/18 00:02:04 sob Exp $
  #
  # $Log:	Configure,v $
  # Revision 4.3.2.15  89/12/18  00:02:04  sob
  # Fixed bug reported by Jim Thompson <jthomp@sun.com> on the
  # use of ypmatch against the so-called services.byname YP map.
--- 1,31 ----
! #!/bin/sh
  #
  # If these # comments don't work, trim them.  Don't worry about the other
  # shell scripts, Configure will trim # comments from them for you.
  #
! # $Header: Configure,v 4.3.2.21 90/04/14 19:36:38 sob Exp $
  #
  # $Log:	Configure,v $
+ # Revision 4.3.2.21  90/04/14  19:36:38  sob
+ # Added better support for the NeXT.
+ # 
+ # Revision 4.3.2.20  90/04/14  01:53:36  sob
+ # Spelling Problem!
+ # 
+ # Revision 4.3.2.19  90/03/17  21:33:21  sob
+ # Reworked VOIDSIG into SIGRET.
+ # 
+ # Revision 4.3.2.18  90/03/17  17:45:25  sob
+ # Changes to detect when to use termio and when not to.
+ # 
+ # Revision 4.3.2.17  90/03/17  16:53:11  sob
+ # Applied a patch to correctly determine being on a Sun running OS 4.0 or
+ # later.
+ # 
+ # Revision 4.3.2.16  89/12/20  23:20:38  sob
+ # Added hp-ux support suggested by tml@hemuli.atk.vtt.fi. Also,
+ # corrected some bugs reported by tml@hemuli.atk.vtt.fi.
+ # 
  # Revision 4.3.2.15  89/12/18  00:02:04  sob
  # Fixed bug reported by Jim Thompson <jthomp@sun.com> on the
  # use of ypmatch against the so-called services.byname YP map.
***************
*** 108,116 ****
--- 128,140 ----
  nametype=''
  cc=''
  iandd=''
+ include=''
+ rrninclude=''
  termlib=''
  jobslib=''
  ndirlib=''
+ socketdir=''
+ dirtype=''
  libndir=''
  usendir=''
  ndirc=''
***************
*** 158,164 ****
  fcntl=''
  ioctl=''
  normsig=''
! voidsig=''
  havetlib=''
  getpwent=''
  gethostname=''
--- 182,191 ----
  fcntl=''
  ioctl=''
  normsig=''
! sigblock=''
! sigret=''
! getuidgid=''
! getcwd=''
  havetlib=''
  getpwent=''
  gethostname=''
***************
*** 167,172 ****
--- 194,200 ----
  hostcmd=''
  norelay=''
  isrrn=''
+ rdchk=''
  serverfile=''
  NNTPSRC=''
  CONFIG=''
***************
*** 262,268 ****
  Much effort has been expended to ensure that this shell script will run
  on any Unix system.  If despite that it blows up on you, your best bet is
  to edit Configure and run it again.  (Trying to install rn without having run
! Configure is well nigh impossible.)  Also, tell Stan Barber (sob@tmc.edu)
  how he blew it.
  
  This installation script affects things in two ways: 1) it does direct
--- 290,296 ----
  Much effort has been expended to ensure that this shell script will run
  on any Unix system.  If despite that it blows up on you, your best bet is
  to edit Configure and run it again.  (Trying to install rn without having run
! Configure is well nigh impossible.)  Also, tell Stan Barber (rrn@lib.tmc.edu)
  how he blew it.
  
  This installation script affects things in two ways: 1) it does direct
***************
*** 314,320 ****
      echo "The archiver doesn't think $libc is a reasonable library."
      exit 1
  fi
- 
  : make some quick guesses about what we are up against
  echo " "
  echo $n "Hmm...  $c"
--- 342,347 ----
***************
*** 361,367 ****
  fi
  chmod 755 bsd usg v7 eunice
  $eunicefix bsd usg v7 eunice
! 
  : see how we invoke the C preprocessor
  echo " "
  echo "Checking to see how your C preprocessor is invoked..."
--- 388,395 ----
  fi
  chmod 755 bsd usg v7 eunice
  $eunicefix bsd usg v7 eunice
! : define sigret as int
! sigret=int
  : see how we invoke the C preprocessor
  echo " "
  echo "Checking to see how your C preprocessor is invoked..."
***************
*** 391,396 ****
--- 419,425 ----
  	    if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
  		echo "Found it!  You're on a NeXT, aren't you?"
  		cpp='/lib/cpp'
+ 		sigret=void
  	    else
  		echo 'Hmm...maybe you already told me...'
  		case "$cpp" in
***************
*** 416,429 ****
      fi
  fi
  rm -f testcpp.c testcpp.out
! : undefine voidsig
! voidsig=undef
  : check for pdp11
  echo " "
! if usg; then
!     : pdp11 is already defined
! else
!     cat <<'EOT' >pdp11.c
  #ifdef pdp11
  exit 0
  #else
--- 445,455 ----
      fi
  fi
  rm -f testcpp.c testcpp.out
! : define getcwd as undef
! getcwd=undef
  : check for pdp11
  echo " "
! cat <<'EOT' >pdp11.c
  #ifdef pdp11
  exit 0
  #else
***************
*** 430,440 ****
  exit 1
  #endif
  EOT
!     $cpp pdp11.c | grep exit >pdp11
!     chmod 755 pdp11
!     $eunicefix pdp11
!     rm pdp11.c
! fi
  if pdp11; then
      echo "This looks like a pdp11 to me."
  else
--- 456,465 ----
  exit 1
  #endif
  EOT
! $cpp pdp11.c | grep exit >pdp11
! chmod 755 pdp11
! $eunicefix pdp11
! rm pdp11.c
  if pdp11; then
      echo "This looks like a pdp11 to me."
  else
***************
*** 454,460 ****
  rm ultrix.c
  if ultrix; then
      echo "Running ultrix, eh?"
!     voidsig=define
  fi
  
  : check for sun 4.0
--- 479,485 ----
  rm ultrix.c
  if ultrix; then
      echo "Running ultrix, eh?"
!     sigret=void
  fi
  
  : check for sun 4.0
***************
*** 471,482 ****
  rm sun.c
  if sun; then
      echo "This looks like a sun to me."
!     if test -f /usr/kvm/libkvm.a ; then
  	echo "And it appears your are running SunOS 4.0 or greater."
! 	voidsig=define
      fi
  fi
  
  : see if sh knows # comments
  echo " "
  echo "Checking your sh to see if it knows about # comments..."
--- 496,554 ----
  rm sun.c
  if sun; then
      echo "This looks like a sun to me."
!     if test -f /etc/ld.so.cache ; then
  	echo "And it appears your are running SunOS 4.0 or greater."
! 	sigret=void
      fi
  fi
+ : check for hp-ux
+ cat <<'EOT' >hp-ux.c
+ #ifdef hpux
+ exit 0
+ #else
+ exit 1
+ #endif
+ EOT
+ $cpp hp-ux.c | grep exit >hp-ux
+ chmod 755 hp-ux
+ $eunicefix hp-ux
+ rm hp-ux.c
+ if hp-ux; then
+     echo "Hewlett-Packard must have built this..."
+     getcwd=define
+     socketdir=-lbsdipc
+     if grep 'void[ 	]*(\*signal' /usr/include/sys/signal.h >/dev/null; then
+ 	echo "And it's a modern version!"
+ 	sigret=void
+     fi
+ fi
  
+ : check for sgi
+ cat <<'EOT' >sgi.c
+ #ifdef sgi
+ exit 0
+ #else
+ exit 1
+ #endif
+ EOT
+ $cpp sgi.c | grep exit >sgi
+ chmod 755 sgi
+ $eunicefix sgi
+ rm sgi.c
+ if sgi; then
+     echo "Silicon Graphics must have built this..."
+ 	sigret=void
+ 	include=-I/usr/include/bsd
+ 	rrninclude="-I/usr/include/bsd -DUSG"
+ 	socketdir=-lbsd
+ fi
+ 
+ if bsd; then
+     getuidgid=define
+ else
+     getuidgid=undef
+ fi
+ 
  : see if sh knows # comments
  echo " "
  echo "Checking your sh to see if it knows about # comments..."
***************
*** 643,650 ****
  : test yp
  case $ypmatch in
  ypmatch)
!     $echo "I don't see ypmatch out there, so YP is not available. We'll seach the passwd"
!     $echo "file the old fashioned way!"
      ;;
  *)
      $ypmatch 513/tcp services > /dev/null 2>/dev/null
--- 715,722 ----
  : test yp
  case $ypmatch in
  ypmatch)
!     $echo "I don't see ypmatch out there, so YP is not available. We'll search the"
!     $echo "passwd file the old fashioned way!"
      ;;
  *)
      $ypmatch 513/tcp services > /dev/null 2>/dev/null
***************
*** 1281,1290 ****
  fi
  
  : see if this is a termio system
! if $test -r /usr/include/termio.h -a  ! ultrix -a ! sun ; then
!     termio=define
!     $echo "termio.h found."
! else
      if $test -r /usr/include/sgtty.h ; then
  	termio=undef
  	$echo "sgtty.h found."
--- 1353,1364 ----
  fi
  
  : see if this is a termio system
! ultrix ; ultrix=$?
! sun ; sun=$?
! if $test -r /usr/include/termio.h -a $ultrix -ne 0 -a $sun -ne 0 ; then
!       termio=define
!       $echo "termio.h found."
!   else
      if $test -r /usr/include/sgtty.h ; then
  	termio=undef
  	$echo "sgtty.h found."
***************
*** 1312,1317 ****
--- 1386,1407 ----
      $echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
  fi
  
+ : see if the system has sigblock
+ if $contains sigblock libc.list >/dev/null 2>&1 ; then
+     $echo "sigblock() found."
+     sigblock=define
+ else
+     sigblock=undef
+ fi
+ 
+ : see if the system has rdchk
+ if $contains rdchk libc.list >/dev/null 2>&1 ; then
+     $echo "rdchk() found."
+     rdchk=define
+ else
+     rdchk=undef
+ fi
+ 
  : see if there is a vfork
  if $contains vfork.o libc.list >/dev/null 2>&1 ; then
      $echo "vfork() found."
***************
*** 1418,1424 ****
      normsig=define
      jobslib=''
  fi
- 
  : see if there are directory access routines out there
  if $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ; then
      $echo "Ndir library found."
--- 1508,1513 ----
***************
*** 1431,1436 ****
--- 1520,1526 ----
      usendir=undef
      ndirc=''
      ndiro=''
+     dirtype=direct
  else
      ndirlib=''
      libndir=undef
***************
*** 1439,1445 ****
  	usendir=undef
  	ndirc=''
  	ndiro=''
!     else
  	$echo "No ndir library found and no readdir() found--using ./ndir.c."
  	usendir=define
  	ndirc='ndir.c'
--- 1529,1547 ----
  	usendir=undef
  	ndirc=''
  	ndiro=''
! 	if sgi ; then
! 	dirtype=direct
! 	$echo "Using direct directory structure."
! 	else 
! 		if $test -r /usr/include/sys/dirent.h ; then
! 			$echo "Using dirent directory structure."
! 	    		dirtype=dirent
! 		else
! 			$echo "Using direct directory structure."
! 	    		dirtype=direct
! 		fi
! 	fi
!      else
  	$echo "No ndir library found and no readdir() found--using ./ndir.c."
  	usendir=define
  	ndirc='ndir.c'
***************
*** 1493,1502 ****
  
  EOM
  
! 	ans=''
! 	while $test -z "$ans" ; do
  	$echo $n "Enter the name of the news server file: [$dflt] $c"
  	. myread
  	done
  	serverfile="$ans"
  
--- 1595,1612 ----
  
  EOM
  
! 	ans='blurfl/dyick'
! 	while $test ! -r "$ans" ; do
  	$echo $n "Enter the name of the news server file: [$dflt] $c"
  	. myread
+ 	    case "$ans" in
+ 	    '') ans="$dflt";;
+ 	    esac
+ 	    ans=`filexp "$ans"`
+ 	    if $test ! -r $ans ; then
+ 		$echo "Can't find $ans"
+ 		ans='blurfl/dyick'
+ 	    fi
  	done
  	serverfile="$ans"
  
***************
*** 1535,1541 ****
--- 1645,1663 ----
      esac
  
  done
+ : hack for Unisys NET-5000
+ case "$isrrn" in
+ define) 
+     if $test -d /usr/include/NET-5000 ; then
+ 	$echo "I sense you are on a Unisys 5000 computer...poor soul."
+ 	rrninclude="-I/usr/include/NET-5000 -DEXCELAN -DUSG"
+ 	socketdir=-lsocket
+     fi
+     ;;
+ *) ;;
+ esac
  
+ 
  case "$spool" in
  '')
      dflt=/usr/spool/news
***************
*** 2057,2064 ****
--- 2179,2191 ----
  nametype='$nametype'
  cc='$cc'
  iandd='$iandd'
+ include='$include'
+ rrninclude='$rrninclude'
  termlib='$termlib'
  jobslib='$jobslib'
+ socketlib='$socketlib'
+ getcwd='$getcwd'
+ dirtype='$dirtype'
  ndirlib='$ndirlib'
  libndir='$libndir'
  usendir='$usendir'
***************
*** 2107,2113 ****
  fcntl='$fcntl'
  ioctl='$ioctl'
  normsig='$normsig'
! voidsig='$voidsig'
  havetlib='$havetlib'
  getpwent='$getpwent'
  gethostname='$gethostname'
--- 2234,2242 ----
  fcntl='$fcntl'
  ioctl='$ioctl'
  normsig='$normsig'
! sigblock='$sigblock'
! sigret='$sigret'
! getuidgid='$getuidgid'
  havetlib='$havetlib'
  getpwent='$getpwent'
  gethostname='$gethostname'
***************
*** 2115,2121 ****
--- 2244,2252 ----
  phostname='$phostname'
  hostcmd='$hostcmd'
  norelay='$norelay'
+ rdchk='$rdchk'
  isrrn='$isrrn'
+ serverfile='$serverfile'
  NNTPSRC='$NNTPSRC'
  CONFIG=true
  EOT
***************
*** 2182,2189 ****
--- 2313,2324 ----
  #$novfork	vfork fork	/* is vfork too virtual? */
  #$eunice	EUNICE		/* no linking? */
  #$eunice	VMS		/* not currently used, here just in case */
+ #$getcwd	GETCWD		/* do we have getcwd()? */
  #$usendir	USENDIR		/* include ndir.c? */
  #$libndir	LIBNDIR		/* include /usr/include/ndir.h? */
+ #ifndef USENDIR
+ #define		DIRTYPE   $dirtype
+ #endif
  #$mininact	MININACT	/* include 2.10.2 optimization? */
  #$portable	PORTABLE	/* do we do extra lookups to start up? */
  #$passnam	PASSNAMES	/* do names come from the passwd file? */
***************
*** 2193,2204 ****
  #$usgnam	USGNAMES	/* or are they USG format? */
  				/* (that is, ":stuff-name(stuff):") */
  #$whoami	WHOAMI		/* should we include whoami.h? */
  #$termio	TERMIO		/* is this a termio system? */
  #$fcntl		FCNTL		/* should we include fcntl.h? */
  #$ioctl		IOCTL		/* are ioctl args all defined in one place? */
  #$normsig	NORMSIG		/* use signal rather than sigset? */
! #$voidsig	VOIDSIG		/* signal returns void? */
  #$havetlib	HAVETERMLIB	/* do we have termlib-style routines? */
  #$getpwent	GETPWENT	/* should we include getpwent? */
  #$internet	INTERNET	/* does our mailer do INTERNET addressing? */
  #$gethostname	GETHOSTNAME	/* do we have a gethostname function? */
--- 2328,2342 ----
  #$usgnam	USGNAMES	/* or are they USG format? */
  				/* (that is, ":stuff-name(stuff):") */
  #$whoami	WHOAMI		/* should we include whoami.h? */
+ #$rdchk		RDCHK		/* do we have rdchk()? */
  #$termio	TERMIO		/* is this a termio system? */
  #$fcntl		FCNTL		/* should we include fcntl.h? */
  #$ioctl		IOCTL		/* are ioctl args all defined in one place? */
  #$normsig	NORMSIG		/* use signal rather than sigset? */
! #$sigblock	SIGBLOCK	/* use sigblock and sigsetmask */
! #define	    	SIGRET	$sigret	/* what does signal() return? */
  #$havetlib	HAVETERMLIB	/* do we have termlib-style routines? */
+ #$getuidgid	GETUIDGID	/* allow setuid (if possible) */
  #$getpwent	GETPWENT	/* should we include getpwent? */
  #$internet	INTERNET	/* does our mailer do INTERNET addressing? */
  #$gethostname	GETHOSTNAME	/* do we have a gethostname function? */
Index: Makefile.SH
Prereq: 4.3.2.7
*** Makefile.SH	Sun Apr 15 02:33:04 1990
--- ../rn/Makefile.SH	Sat Apr 14 22:22:47 1990
***************
*** 3,11 ****
  esac
  echo "Extracting Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 4.3.2.7 89/12/09 01:49:48 sob Exp $
  #
  # $Log:	Makefile.SH,v $
  # Revision 4.3.2.7  89/12/09  01:49:48  sob
  # make clean cleans up better.
  # 
--- 3,14 ----
  esac
  echo "Extracting Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 4.3.2.8 89/12/20 23:20:14 sob Exp $
  #
  # $Log:	Makefile.SH,v $
+ # Revision 4.3.2.8  89/12/20  23:20:14  sob
+ # Added "hp-ux" to the list of files created by Configure.
+ # 
  # Revision 4.3.2.7  89/12/09  01:49:48  sob
  # make clean cleans up better.
  # 
***************
*** 12,18 ****
  # Revision 4.3.2.6  89/12/08  22:43:45  sob
  # Added suggestions by weening@gang-of-four.stanford.edu and 
  # jik@pit-manager.mit.edu. rrn manual page is now created when
! # doing an instllation. getactive will only be made when rrn is being
  # created.
  # 
  # Revision 4.3.2.5  89/11/08  04:47:38  sob
--- 15,21 ----
  # Revision 4.3.2.6  89/12/08  22:43:45  sob
  # Added suggestions by weening@gang-of-four.stanford.edu and 
  # jik@pit-manager.mit.edu. rrn manual page is now created when
! # doing an installation. getactive will only be made when rrn is being
  # created.
  # 
  # Revision 4.3.2.5  89/11/08  04:47:38  sob
***************
*** 46,57 ****
  mansrc = $mansrc
  manext = $manext
  #NNTPNNTPDIR = $NNTPSRC
! CFLAGS = $iandd -O
  LDFLAGS = $iandd
  NDIRC = $ndirc
  NDIRO = $ndiro
  
! libs = $ndirlib $termlib $jobslib
  !GROK!THIS!
  cat >>Makefile <<'!NO!SUBS!'
  #NNTPnntp=getactive
--- 49,61 ----
  mansrc = $mansrc
  manext = $manext
  #NNTPNNTPDIR = $NNTPSRC
! #NNTPNNTPINC = $rrninclude
! CFLAGS = $iandd -O $include
  LDFLAGS = $iandd
  NDIRC = $ndirc
  NDIRO = $ndiro
  
! libs = $ndirlib $termlib $jobslib $socketdir
  !GROK!THIS!
  cat >>Makefile <<'!NO!SUBS!'
  #NNTPnntp=getactive
***************
*** 91,97 ****
  add2 = bsd config.h config.sh eunice filexp
  add3 = loc makedepend makedir mbox.saver newsetup
  add4 = newsgroups newsnews ng.help norm.saver pager.help
! add5 = pdp11 rn subs.help usg v7 ultrix sun server.h
  
  addedbyconf = $(add1) $(add2) $(add3) $(add4) $(add5)
  
--- 95,101 ----
  add2 = bsd config.h config.sh eunice filexp
  add3 = loc makedepend makedir mbox.saver newsetup
  add4 = newsgroups newsnews ng.help norm.saver pager.help
! add5 = pdp11 rn subs.help usg v7 ultrix sun hp-ux sgi server.h
  
  addedbyconf = $(add1) $(add2) $(add3) $(add4) $(add5)
  
***************
*** 112,118 ****
  
  # Eek! This is gross.
  $(NNTPDIR)/common/clientlib.o:
! 	$(CC) -c $(CFLAGS) $(NNTPDIR)/common/clientlib.c
  	mv clientlib.o $(NNTPDIR)/common/clientlib.o
  
  # if a .h file depends on another .h file...
--- 116,122 ----
  
  # Eek! This is gross.
  $(NNTPDIR)/common/clientlib.o:
! 	$(CC) -c $(CFLAGS) $(NNTPINC) $(NNTPDIR)/common/clientlib.c
  	mv clientlib.o $(NNTPDIR)/common/clientlib.o
  
  # if a .h file depends on another .h file...
Index: addng.c
Prereq: 4.3.2.3
*** addng.c	Sun Apr 15 02:32:49 1990
--- ../rn/addng.c	Sat Apr 14 22:21:49 1990
***************
*** 1,6 ****
! /* $Header: addng.c,v 4.3.2.3 89/11/08 02:33:28 sob Locked $
   *
   * $Log:	addng.c,v $
   * Revision 4.3.2.3  89/11/08  02:33:28  sob
   * Added include for server.h
   * 
--- 1,12 ----
! /* $Header: addng.c,v 4.3.2.4 90/03/17 17:11:36 sob Exp $
   *
   * $Log:	addng.c,v $
+  * Revision 4.3.2.4  90/03/17  17:11:36  sob
+  * Added support for CNEWS active file flags.
+  * 
+  * Revision 4.3.2.4  89/12/20  00:30:00  tale
+  * Added support for C News active file flags.
+  *
   * Revision 4.3.2.3  89/11/08  02:33:28  sob
   * Added include for server.h
   * 
***************
*** 51,57 ****
  bool checkinlist;
  {
      char *tmpname;
!     register char *s;
      long birthof();
  
      tmpname = savestr(filexp("/tmp/rnew.%$"));
--- 57,63 ----
  bool checkinlist;
  {
      char *tmpname;
!     register char *s, *status;
      long birthof();
  
      tmpname = savestr(filexp("/tmp/rnew.%$"));
***************
*** 62,69 ****
      }
      while (fgets(buf,LBUFLEN,actfp) != Nullch) {
  	if (s = index(buf,' ')) {
  	    *s++ = '\0';
! 	    if (strnEQ(buf,"to.",3))
  		continue;
  	    if (find_ng(buf) == nextrcline &&
  		    (checkinlist ?
--- 68,79 ----
      }
      while (fgets(buf,LBUFLEN,actfp) != Nullch) {
  	if (s = index(buf,' ')) {
+ 	    status=s;
+ 	    while (isdigit(*status) || isspace(*status)) status++;
  	    *s++ = '\0';
! 	    if (strnEQ(buf,"to.",3) || *status == 'x' || *status == '=')
! 	        /* since = groups are refiling to another group, just
! 		   ignore their existence */
  		continue;
  	    if (find_ng(buf) == nextrcline &&
  		    (checkinlist ?
Index: art.c
Prereq: 4.3.2.1
*** art.c	Sun Apr 15 02:32:34 1990
--- ../rn/art.c	Sat Apr 14 22:22:18 1990
***************
*** 1,6 ****
! /* $Header: art.c,v 4.3.2.1 89/11/07 23:20:57 sob Locked $
   *
   * $Log:	art.c,v $
   * Revision 4.3.2.1  89/11/07  23:20:57  sob
   * Bug fixes for NNTP
   * 
--- 1,9 ----
! /* $Header: art.c,v 4.3.2.2 90/03/22 23:03:25 sob Exp $
   *
   * $Log:	art.c,v $
+  * Revision 4.3.2.2  90/03/22  23:03:25  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.1  89/11/07  23:20:57  sob
   * Bug fixes for NNTP
   * 
***************
*** 558,564 ****
  	else
  	    erase_eol();	/* and erase the prompt */
  #endif CLEAREOL
! 	fflush(stdout);
  
      fake_command:		/* used by innersearch */
  
--- 561,567 ----
  	else
  	    erase_eol();	/* and erase the prompt */
  #endif CLEAREOL
!  	carriage_return(); /* Resets kernels tab coloumn counter to 0 */	fflush(stdout);
  
      fake_command:		/* used by innersearch */
  
***************
*** 629,634 ****
--- 632,638 ----
  	}
  	carriage_return();
  	erase_eol();	/* erase the prompt */
+  	carriage_return(); /* Resets kernels tab coloumn counter to 0 */
  	/* FALL THROUGH */
      caseG:
      case 'G': {
***************
*** 722,727 ****
--- 726,732 ----
  	}
  #endif
  	clear();
+  	carriage_return(); /* Resets kernels tab coloumn counter to 0 */
  	do_fseek = TRUE;
  	artline = topline;
  	if (artline < 0)
***************
*** 744,756 ****
  	    clear();
  
  #endif CLEAREOL
  	do_fseek = TRUE;	/* reposition article file */
  	target = topline - (LINES - 2);
  	artline = topline;
! 	do {
  	    artline--;
- 	} while (artline >= 0 && artline > target &&
- 	    vrdary(artline-1) >= 0);
  	topline = artline;
  			/* remember top line of screen */
  			/*  (line # within article file) */
--- 749,760 ----
  	    clear();
  
  #endif CLEAREOL
+  	carriage_return(); /* Resets kernels tab coloumn counter to 0 */
  	do_fseek = TRUE;	/* reposition article file */
  	target = topline - (LINES - 2);
  	artline = topline;
! 	while (artline >= 0 && artline > target && vrdary(artline-1) >= 0)
  	    artline--;
  	topline = artline;
  			/* remember top line of screen */
  			/*  (line # within article file) */
Index: artio.c
Prereq: 4.3.2.4
*** artio.c	Sun Apr 15 02:33:06 1990
--- ../rn/artio.c	Sat Apr 14 22:22:49 1990
***************
*** 1,6 ****
! /* $Header: artio.c,v 4.3.2.4 89/11/27 01:29:57 sob Locked $
   *
   * $Log:	artio.c,v $
   * Revision 4.3.2.4  89/11/27  01:29:57  sob
   * Altered NNTP code per ideas suggested by Bela Lubkin
   * <filbo@gorn.santa-cruz.ca.us>
--- 1,9 ----
! /* $Header: artio.c,v 4.3.2.5 90/03/22 23:04:04 sob Exp $
   *
   * $Log:	artio.c,v $
+  * Revision 4.3.2.5  90/03/22  23:04:04  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.4  89/11/27  01:29:57  sob
   * Altered NNTP code per ideas suggested by Bela Lubkin
   * <filbo@gorn.santa-cruz.ca.us>
***************
*** 138,143 ****
--- 141,147 ----
  	fclose(artfp);
  	artfp = Nullfp;
  	UNLINK(artname);
+  	errno = ENOENT;		/* Simulate file-not-found */
          return Nullfp;
      }
  
Index: common.h
Prereq: 4.3.2.7
*** common.h	Sun Apr 15 02:32:07 1990
--- ../rn/common.h	Sat Apr 14 22:22:01 1990
***************
*** 1,6 ****
! /* $Header: common.h,v 4.3.2.7 89/12/08 22:43:12 sob Exp $
   * 
   * $Log:	common.h,v $
   * Revision 4.3.2.7  89/12/08  22:43:12  sob
   * Corrected typo pointed out by weening@gang-of-four.stanford.edu
   * 
--- 1,18 ----
! /* $Header: common.h,v 4.3.2.11 90/04/14 19:37:07 sob Exp $
   * 
   * $Log:	common.h,v $
+  * Revision 4.3.2.11  90/04/14  19:37:07  sob
+  * Added better support for the NeXT.
+  * 
+  * Revision 4.3.2.10  90/04/06  20:54:12  sob
+  * Corrected forward definition of fseek()
+  * 
+  * Revision 4.3.2.9  90/03/17  21:19:04  sob
+  * Removed the incorrect forward definition of sprintf().
+  * 
+  * Revision 4.3.2.8  89/12/20  20:40:03  sob
+  * Changed ACT_POS from short to long per suggestion from eps@cd.SFSU.EDU.
+  * 
   * Revision 4.3.2.7  89/12/08  22:43:12  sob
   * Corrected typo pointed out by weening@gang-of-four.stanford.edu
   * 
***************
*** 115,124 ****
  #   define BERKELEY 	/* include job control signals? */
  #endif
  
- #ifdef SIGPROF
- #   define BSD42		/* do we have Berkeley 4.2? */
- #endif
- 
  #ifdef FIONREAD
  #   define PENDING
  #else
--- 127,132 ----
***************
*** 273,283 ****
  #define TILDENAME	/* allow ~logname expansion */
  #define SETENV		/* allow command line environment variable setting */
  #define GETWD		/* use our getwd() instead of piped in pwd */
- #ifndef BSD42		/* 4.2 sites should just use groups for this */
- #define SETUIDGID	/* substitute eaccess() for access() so that rn */
- 			/* can run setuid or setgid */
- 			/* if not setuid or setgid, you don't need it */
- #endif
  #define MAKEDIR		/* use our makedir() instead of shell script */
  #define MEMHELP		/* keep help messages in memory */
  #define VERBOSE		/* compile in more informative messages */
--- 281,286 ----
***************
*** 716,722 ****
  #endif
  typedef long		ART_POS;	/* char position in article file */
  typedef int		ART_LINE;	/* line position in article file */
! typedef short		ACT_POS;	/* char position in active file */
  typedef unsigned int	MEM_SIZE;	/* for passing to malloc */
  
  
--- 719,725 ----
  #endif
  typedef long		ART_POS;	/* char position in article file */
  typedef int		ART_LINE;	/* line position in article file */
! typedef long		ACT_POS;	/* char position in active file */
  typedef unsigned int	MEM_SIZE;	/* for passing to malloc */
  
  
***************
*** 735,741 ****
  char	*getenv();
  char	*strcat();
  char	*strcpy();
- char	*sprintf();
  
  EXT char buf[LBUFLEN+1];	/* general purpose line buffer */
  EXT char cmd_buf[CBUFLEN];	/* buffer for formatting system commands */
--- 738,743 ----
***************
*** 796,802 ****
  
  /* miscellania */
  
! long atol(), fseek(), ftell();
  EXT bool in_ng INIT(FALSE);		/* current state of rn */
  EXT char mode INIT('i');		/* current state of rn */
  
--- 798,805 ----
  
  /* miscellania */
  
! int fseek();
! long atol(), ftell();
  EXT bool in_ng INIT(FALSE);		/* current state of rn */
  EXT char mode INIT('i');		/* current state of rn */
  
Index: final.c
Prereq: 4.3
*** final.c	Mon Apr 16 15:20:32 1990
--- ../rn/final.c	Sat Apr 14 22:22:49 1990
***************
*** 1,6 ****
! /* $Header: final.c,v 4.3 85/05/01 11:38:08 lwall Exp $
   *
   * $Log:	final.c,v $
   * Revision 4.3  85/05/01  11:38:08  lwall
   * Baseline for release with 4.3bsd.
   * 
--- 1,32 ----
! /* $Header: final.c,v 4.3.2.8 90/04/14 19:37:14 sob Exp $
   *
   * $Log:	final.c,v $
+  * Revision 4.3.2.8  90/04/14  19:37:14  sob
+  * Added better support for the NeXT.
+  * 
+  * Revision 4.3.2.7  90/03/17  21:33:49  sob
+  * cleaned up a bit
+  * 
+  * Revision 4.3.2.6  90/03/17  16:48:25  sob
+  * Added changes to insure that rrn cleans up its temporary files when
+  * exiting.
+  * 
+  * Revision 4.3.2.5  89/11/28  01:51:28  sob
+  * Now handles SIGWINCH correctly.
+  * 
+  * Revision 4.3.2.4  89/11/27  01:30:24  sob
+  * Altered NNTP code per ideas suggested by Bela Lubkin
+  * <filbo@gorn.santa-cruz.ca.us>
+  * 
+  * Revision 4.3.2.3  89/11/08  02:25:07  sob
+  * Integrated modifications from other RRN patches colleceted from USENET
+  * 
+  * Revision 4.3.2.2  89/11/07  23:26:31  sob
+  * Added some fixes that relate to SIGSTP
+  * 
+  * Revision 4.3.2.1  89/11/06  00:16:08  sob
+  * Added RRN support from NNTP 1.5
+  *
   * Revision 4.3  85/05/01  11:38:08  lwall
   * Baseline for release with 4.3bsd.
   * 
***************
*** 15,20 ****
--- 41,48 ----
  #include "bits.h"
  #include "last.h"
  #include "rcstuff.h"
+ #include "ngdata.h"
+ #include "artio.h"
  #include "INTERN.h"
  #include "final.h"
  
***************
*** 23,29 ****
  {
  #ifdef SIGTSTP
      sigset(SIGTSTP, stop_catcher);	/* job control signals */
!     sigset(SIGCONT, cont_catcher);	/* job control signals */
  #endif
  
      sigset(SIGINT, int_catcher);	/* always catch interrupts */
--- 51,58 ----
  {
  #ifdef SIGTSTP
      sigset(SIGTSTP, stop_catcher);	/* job control signals */
!     sigset(SIGTTOU, stop_catcher);	/* job control signals */
!     sigset(SIGTTIN, stop_catcher);	/* job control signals */
  #endif
  
      sigset(SIGINT, int_catcher);	/* always catch interrupts */
***************
*** 45,50 ****
--- 74,82 ----
  #ifdef SIGXFSZ
      sigset(SIGXFSZ, sig_catcher);
  #endif
+ #ifdef SIGWINCH
+     sigset(SIGWINCH, winch_catcher);
+ #endif
  }
  
  void					/* very much void */
***************
*** 51,59 ****
  finalize(status)
  int status;
  {
      if (bizarre)
  	resetty();
!     UNLINK(lockname);
      if (status < 0) {
  	chdir("/usr/tmp");
  	sigset(SIGILL,SIG_DFL);
--- 83,106 ----
  finalize(status)
  int status;
  {
+ #ifdef SERVER
+     char artname[32];
+ #endif SERVER
+ 
      if (bizarre)
  	resetty();
!     if (lockname && *lockname)
!  	UNLINK(lockname);
! #ifdef SERVER
!     if (*active_name)
! 	UNLINK(active_name);
!     if (openart) {
!  	char artname[32];
!  	sprintf(artname, "/tmp/rrn%ld.%d", (long)openart, getpid());
!  	UNLINK(artname);
!     }
!     close_server();
! #endif SERVER
      if (status < 0) {
  	chdir("/usr/tmp");
  	sigset(SIGILL,SIG_DFL);
***************
*** 123,133 ****
  	};
  #endif
  
- #ifdef SIGTTOU
- #ifndef lint
-     sigignore(SIGTTOU);
- #endif lint
- #endif
  #ifdef DEBUGGING
      if (debug) {
  	printf("\nSIG%s--.newsrc not restored in debug\n",signame[signo]);
--- 170,175 ----
***************
*** 169,175 ****
  /* come here on stop signal */
  
  int
! stop_catcher()
  {
      if (!waiting) {
  	checkpoint_rc();		/* good chance of crash while stopped */
--- 211,218 ----
  /* come here on stop signal */
  
  int
! stop_catcher(signo)
! int signo;
  {
      if (!waiting) {
  	checkpoint_rc();		/* good chance of crash while stopped */
***************
*** 178,214 ****
  	if (debug)
  	    write(2,"stop_catcher\n",13);
  #endif
! 	sigset(SIGTSTP,SIG_DFL);	/* enable stop */
! #ifdef BSD42
! 	sigsetmask(sigblock(0) & ~(1 << (SIGTSTP-1)));
  #endif
! 	kill(0,SIGTSTP);		/* and do the stop */
!     }
!     sigset(SIGTSTP,stop_catcher);	/* unenable the stop */
! }
! 
! /* come here on cont signal */
! 
! int
! cont_catcher()
! {
!     sigset(SIGCONT,cont_catcher);
!     savetty();
! #ifdef MAILCALL;
!     mailcount = 0;			/* force recheck */
  #endif
!     if (!panic) {
! 	if (!waiting) {
! #ifdef DEBUGGING
! 	    if (debug)
! 		write(2,"cont_catcher\n",13);
! #endif
! 	    noecho();			/* set no echo */
! 	    crmode();			/* set cbreak mode */
! 	    forceme("\f");		/* cause a refresh */
  					/* (defined only if TIOCSTI defined) */
! 	}
      }
  }
  #endif
- 
--- 221,245 ----
  	if (debug)
  	    write(2,"stop_catcher\n",13);
  #endif
! 	sigset(signo,SIG_DFL);	/* enable stop */
! #ifdef SIGBLOCK
! 	sigsetmask(sigblock(0) & ~(1 << (signo-1)));
  #endif
! 	kill(0,signo);		/* and do the stop */
!     	savetty();
! #ifdef MAILCALL
!     	mailcount = 0;			/* force recheck */
  #endif
!     	if (!panic) {
! 	    if (!waiting) {
! 	    	noecho();			/* set no echo */
! 	    	crmode();			/* set cbreak mode */
! 	    	forceme("\f");		/* cause a refresh */
  					/* (defined only if TIOCSTI defined) */
! 		errno = 0;			/* needed for getcmd */
! 	    }
!     	}
      }
+     sigset(signo,stop_catcher);	/* unenable the stop */
  }
  #endif
Index: head.c
Prereq: 4.3.2.4
*** head.c	Sun Apr 15 02:32:55 1990
--- ../rn/head.c	Sat Apr 14 22:21:56 1990
***************
*** 1,6 ****
! /* $Header: head.c,v 4.3.2.4 89/11/27 01:30:35 sob Locked $
   *
   * $Log:	head.c,v $
   * Revision 4.3.2.4  89/11/27  01:30:35  sob
   * Altered NNTP code per ideas suggested by Bela Lubkin
   * <filbo@gorn.santa-cruz.ca.us>
--- 1,9 ----
! /* $Header: head.c,v 4.3.2.5 90/03/22 23:04:22 sob Exp $
   *
   * $Log:	head.c,v $
+  * Revision 4.3.2.5  90/03/22  23:04:22  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.4  89/11/27  01:30:35  sob
   * Altered NNTP code per ideas suggested by Bela Lubkin
   * <filbo@gorn.santa-cruz.ca.us>
***************
*** 77,82 ****
--- 80,88 ----
      register char *t, *f;
      register int i, len;
  
+     if (colon-bufptr > LONGKEY+2)
+ 	return SOME_LINE;
+ 
      for (t=lc,f=bufptr; f<colon; f++, t++) {
  	if (isspace(*f))
  	/* guard against space before : */
***************
*** 140,146 ****
  					/* remember where line left off */
  	}
  	s = index(art_buf,':');
! 	if (s == Nullch || s-art_buf > LONGKEY+2) {
  			    /* is it the end of the header? */
  	    htype[PAST_HEADER].ht_minpos =
  		(*art_buf == '\n') ? ftell(artfp) : artpos;
--- 146,152 ----
  					/* remember where line left off */
  	}
  	s = index(art_buf,':');
! 	if (s == Nullch) {
  			    /* is it the end of the header? */
  	    htype[PAST_HEADER].ht_minpos =
  		(*art_buf == '\n') ? ftell(artfp) : artpos;
Index: init.c
Prereq: 4.3.2.2
*** init.c	Sun Apr 15 02:32:56 1990
--- ../rn/init.c	Sat Apr 14 22:22:39 1990
***************
*** 1,6 ****
! /* $Header: init.c,v 4.3.2.2 89/11/08 01:17:48 sob Locked $
   *
   * $Log:	init.c,v $
   * Revision 4.3.2.2  89/11/08  01:17:48  sob
   * Added changes to insure that this will compile for RN or RRN with no
   * changes to the source code.
--- 1,12 ----
! /* $Header: init.c,v 4.3.2.4 90/03/22 23:04:32 sob Exp $
   *
   * $Log:	init.c,v $
+  * Revision 4.3.2.4  90/03/22  23:04:32  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
+  * Revision 4.3.2.3  90/03/17  21:34:04  sob
+  * Cleaned up a bit.
+  * 
   * Revision 4.3.2.2  89/11/08  01:17:48  sob
   * Added changes to insure that this will compile for RN or RRN with no
   * changes to the source code.
***************
*** 181,204 ****
      backpage_init();
      bits_init();
      cheat_init();
- /*  final_init();	already done */
      head_init();
      help_init();
- /*  intrp_init();      already done */
      kfile_init();
- /*  last_init();	already done */
      ng_init();
- /*  ngdata_init();	already done */
      ngsrch_init();
      ngstuff_init();
      only_init();
      rcln_init();
- /*  rcstuff_init();	already done */
      respond_init();
      rn_init();
      search_init();
- /*  sw_init();      already done */
- /*  term_init();	already done */
      util_init();
  
  #ifdef FINDNEWNG
--- 187,203 ----
***************
*** 319,325 ****
  #ifdef TERSE
  		    fputs("\nCan't start another.\n",stdout) FLUSH;
  #endif
! 		finalize(0);
  	    }
  	}
  	tmpfp = fopen(lockname,"w");
--- 318,324 ----
  #ifdef TERSE
  		    fputs("\nCan't start another.\n",stdout) FLUSH;
  #endif
! 		exit(0);
  	    }
  	}
  	tmpfp = fopen(lockname,"w");
Index: intrp.c
Prereq: 4.3.2.1
*** intrp.c	Sun Apr 15 02:32:18 1990
--- ../rn/intrp.c	Sat Apr 14 22:22:10 1990
***************
*** 1,6 ****
! /* $Header: intrp.c,v 4.3.2.1 89/12/17 02:54:55 sob Exp $
   *
   * $Log:	intrp.c,v $
   * Revision 4.3.2.1  89/12/17  02:54:55  sob
   * Removed redundant include directive.
   * 
--- 1,13 ----
! /* $Header: intrp.c,v 4.3.2.3 90/03/22 23:04:35 sob Exp $
   *
   * $Log:	intrp.c,v $
+  * Revision 4.3.2.3  90/03/22  23:04:35  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
+  * Revision 4.3.2.2  90/03/17  17:03:12  sob
+  * Fixed determination of the news superuser's id. Fix provided by Chip
+  * Rosenthal <chip@chinacat.lonestar.org>.
+  * 
   * Revision 4.3.2.1  89/12/17  02:54:55  sob
   * Removed redundant include directive.
   * 
***************
*** 244,250 ****
  			if (strEQ(scrbuf,tildename)) {
  #ifdef NEWSADMIN
  			    if (strEQ(newsadmin,tildename))
! 				newsuid = atoi(index(d,':')+1);
  #endif
  			    for (i=LOGDIRFIELD-2; i; i--) {
  				if (d)
--- 251,257 ----
  			if (strEQ(scrbuf,tildename)) {
  #ifdef NEWSADMIN
  			    if (strEQ(newsadmin,tildename))
! 				newsuid = atoi(index(d+1,':')+1);
  #endif
  			    for (i=LOGDIRFIELD-2; i; i--) {
  				if (d)
***************
*** 711,716 ****
--- 718,732 ----
  		    if (htype[REFS_LINE].ht_minpos >= 0) {
  			refs_buf = fetchlines(art,REFS_LINE);
  			refscpy(scrbuf,(sizeof scrbuf),refs_buf);
+ 			/* no more than 3 prior references allowed,
+ 			** including the one concatenated below */
+ 			if ((s = rindex(scrbuf,'<')) > scrbuf) {
+ 			    *s = '\0';
+ 			    h = rindex(scrbuf,'<');
+ 			    *s = '<';
+ 			    if (h > scrbuf)
+ 				strcpy(scrbuf,h);
+ 			}
  		    }
  		    else
  			*scrbuf = '\0';
Index: kfile.c
Prereq: 4.3.1.3
*** kfile.c	Sun Apr 15 02:32:59 1990
--- ../rn/kfile.c	Sat Apr 14 22:22:42 1990
***************
*** 1,6 ****
! /* $Header: kfile.c,v 4.3.1.3 85/05/29 09:11:52 lwall Exp $
   *
   * $Log:	kfile.c,v $
   * Revision 4.3.1.3  85/05/29  09:11:52  lwall
   * Suppressed some killing messages on -t.
   * 
--- 1,9 ----
! /* $Header: kfile.c,v 1.2 90/03/22 23:04:41 sob Exp $
   *
   * $Log:	kfile.c,v $
+  * Revision 1.2  90/03/22  23:04:41  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.1.3  85/05/29  09:11:52  lwall
   * Suppressed some killing messages on -t.
   * 
***************
*** 72,77 ****
--- 75,82 ----
      fflush(stdout);
  }
  
+ bool kill_mentioned;
+ 
  int
  do_kfile(kfp,entering)
  FILE *kfp;
***************
*** 108,113 ****
--- 113,119 ----
  	}
  	else if (*buf == '/' && firstart <= lastart) {
  	    mention(buf);
+ 	    kill_mentioned = TRUE;
  	    switch (art_search(buf, (sizeof buf), FALSE)) {
  	    case SRCH_ABORT:
  		continue;
***************
*** 156,165 ****
  	firstart = starting;
  	clear();
  #ifdef VERBOSE
! 	IF(verbose)
! 	    if (message)
! 		fputs(message,stdout) FLUSH;
  #endif
  	if (localkfp)
  	    intr = do_kfile(localkfp,entering);
  	if (globkfp && !intr)
--- 162,178 ----
  	firstart = starting;
  	clear();
  #ifdef VERBOSE
! # ifdef TERSE
! 	if (message && (verbose || entering))
! # else
! 	if (message)
! # endif
! #else
! 	if (message && entering)
  #endif
+ 	    fputs(message,stdout) FLUSH;
+ 
+ 	kill_mentioned = FALSE;
  	if (localkfp)
  	    intr = do_kfile(localkfp,entering);
  	if (globkfp && !intr)
***************
*** 167,176 ****
  	if (entering && localkfp && !intr)
  	    setthru(lastart);
  	putchar('\n') FLUSH;
  #ifdef VERBOSE
! 	IF(verbose)
! 	    if (entering)
  		get_anything();
  #endif
  	if (anytokill)			/* if there was anything to kill */
  	    forcelast = FALSE;		/* allow for having killed it all */
--- 180,193 ----
  	if (entering && localkfp && !intr)
  	    setthru(lastart);
  	putchar('\n') FLUSH;
+ 	if (entering && kill_mentioned)
  #ifdef VERBOSE
! 	    IF(verbose)
  		get_anything();
+ 	    ELSE
+ #endif
+ #ifdef TERSE
+ 		pad(just_a_sec/3);
  #endif
  	if (anytokill)			/* if there was anything to kill */
  	    forcelast = FALSE;		/* allow for having killed it all */
Index: last.c
Prereq: 4.3
*** last.c	Sun Apr 15 02:33:23 1990
--- ../rn/last.c	Sat Apr 14 22:23:03 1990
***************
*** 1,6 ****
! /* $Header: last.c,v 4.3 85/05/01 11:42:16 lwall Exp $
   *
   * $Log:	last.c,v $
   * Revision 4.3  85/05/01  11:42:16  lwall
   * Baseline for release with 4.3bsd.
   * 
--- 1,11 ----
! /* $Header: last.c,v 4.3.2.1 89/12/20 23:23:07 sob Exp $
   *
   * $Log:	last.c,v $
+  * Revision 4.3.2.1  89/12/20  23:23:07  sob
+  * .rnlast sometimes is a null file. This gives bogus information when
+  * restarting rn following an abnormal termination. This bug was reported
+  * by weening@gang-of-four.stanford.edu
+  * 
   * Revision 4.3  85/05/01  11:42:16  lwall
   * Baseline for release with 4.3bsd.
   * 
***************
*** 21,28 ****
  char *tcbuf;
  {
      lastname = savestr(filexp(LASTNAME));
!     if ((tmpfp = fopen(lastname,"r")) != Nullfp) {
! 	fgets(tcbuf,1024,tmpfp);
  	tcbuf[strlen(tcbuf)-1] = '\0';
  	lastngname = savestr(tcbuf);
  	fgets(tcbuf,1024,tmpfp);
--- 26,33 ----
  char *tcbuf;
  {
      lastname = savestr(filexp(LASTNAME));
!     if ((tmpfp = fopen(lastname,"r")) != Nullfp &&
! 	fgets(tcbuf,1024,tmpfp) != Nullch) {
  	tcbuf[strlen(tcbuf)-1] = '\0';
  	lastngname = savestr(tcbuf);
  	fgets(tcbuf,1024,tmpfp);
Index: ng.c
Prereq: 4.3.2.5
*** ng.c	Sun Apr 15 02:32:08 1990
--- ../rn/ng.c	Sat Apr 14 22:22:03 1990
***************
*** 1,6 ****
! /* $Header: ng.c,v 4.3.2.5 89/12/09 01:18:42 sob Exp $
   *
   * $Log:	ng.c,v $
   * Revision 4.3.2.5  89/12/09  01:18:42  sob
   * Fixed a bad call to nntpopen().
   * 
--- 1,9 ----
! /* $Header: ng.c,v 4.3.2.6 90/03/22 23:04:49 sob Exp $
   *
   * $Log:	ng.c,v $
+  * Revision 4.3.2.6  90/03/22  23:04:49  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.5  89/12/09  01:18:42  sob
   * Fixed a bad call to nntpopen().
   * 
***************
*** 970,979 ****
  	    do_fseek = TRUE;
  	    target = topline - (LINES - 2);
  	    artline = topline;
! 	    do {
  		artline--;
- 	    } while (artline >= 0 && artline > target &&
- 		vrdary(artline-1) >= 0);
  	    topline = artline;
  	    if (artline < 0)
  		artline = 0;
--- 973,980 ----
  	    do_fseek = TRUE;
  	    target = topline - (LINES - 2);
  	    artline = topline;
! 	    while (artline >= 0 && artline > target && vrdary(artline-1) >= 0)
  		artline--;
  	    topline = artline;
  	    if (artline < 0)
  		artline = 0;
Index: ngdata.c
Prereq: 4.3.2.6
*** ngdata.c	Sun Apr 15 02:32:57 1990
--- ../rn/ngdata.c	Sat Apr 14 22:22:38 1990
***************
*** 1,6 ****
! /* $Header: ngdata.c,v 4.3.2.6 89/12/08 22:42:04 sob Exp $
   *
   * $Log:	ngdata.c,v $
   * Revision 4.3.2.6  89/12/08  22:42:04  sob
   * Corrected typo in an #ifdef statement pointed out by
   * jik@pit-manager.mit.edu
--- 1,19 ----
! /* $Header: ngdata.c,v 4.3.2.10 90/04/14 22:05:15 sob Exp $
   *
   * $Log:	ngdata.c,v $
+  * Revision 4.3.2.10  90/04/14  22:05:15  sob
+  * Removed redundant declaration of active_name
+  * 
+  * Revision 4.3.2.9  90/03/22  23:04:55  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
+  * Revision 4.3.2.8  90/03/17  20:50:51  sob
+  * Fixes provided by stewart@netxcom.iad-nxe.global-mis.dhl.com to handle
+  * flaky transfers of the active file from the server.
+  * 
+  * Revision 4.3.2.7  90/03/17  17:11:08  sob
+  * Added support for CNEWS active file flags.
+  *
   * Revision 4.3.2.6  89/12/08  22:42:04  sob
   * Corrected typo in an #ifdef statement pointed out by
   * jik@pit-manager.mit.edu
***************
*** 41,50 ****
  #include "INTERN.h"
  #include "ngdata.h"
  
- #ifdef SERVER
- char    active_name[256];
- #endif SERVER
- 
  void
  ngdata_init()
  {
--- 54,59 ----
***************
*** 51,56 ****
--- 60,66 ----
  #ifdef SERVER
      char ser_line[256];
      char *cp;
+     int entries;
  #endif
  /* The following is only for systems that do not zero globals properly */
  #ifdef ZEROGLOB
***************
*** 65,71 ****
  #ifdef SERVER
  
      put_server("LIST");		/* tell server we want the active file */
!     (void) get_server(ser_line, sizeof(ser_line));
      if (*ser_line != CHAR_OK) {		/* and then see if that's ok */
  	fprintf(stdout, "Can't get active file from server: \n%s\n", ser_line);
  	finalize(1);
--- 75,81 ----
  #ifdef SERVER
  
      put_server("LIST");		/* tell server we want the active file */
!     get_server(ser_line, sizeof(ser_line));
      if (*ser_line != CHAR_OK) {		/* and then see if that's ok */
  	fprintf(stdout, "Can't get active file from server: \n%s\n", ser_line);
  	finalize(1);
***************
*** 75,87 ****
      strcpy(active_name, cp);
      actfp = fopen(active_name, "w+");	/* and get ready */
      if (actfp == Nullfp) {
! 	printf(cantopen,filexp(ACTIVE)) FLUSH;
  	finalize(1);
      }
  
!     while (get_server(ser_line, sizeof(ser_line)) >= 0) {  /* while */
! 	if (ser_line[0] == '.')		/* there's another line */
  		break;			/* get it and write it to */
  	fputs(ser_line, actfp);
  	putc('\n', actfp);
      }
--- 85,103 ----
      strcpy(active_name, cp);
      actfp = fopen(active_name, "w+");	/* and get ready */
      if (actfp == Nullfp) {
! 	printf(cantopen,active_name) FLUSH;
  	finalize(1);
      }
  
!     entries = 0;
!     while (1) {
! 	if (get_server(ser_line, sizeof(ser_line)) < 0) {
! 	    printf("Can't get active file from server:\ntransfer failed after %d entries\n", entries);
! 	    finalize(1);
! 	}
! 	if (ser_line[0] == '.')		/* while there's another line */
  		break;			/* get it and write it to */
+ 	entries++;
  	fputs(ser_line, actfp);
  	putc('\n', actfp);
      }
***************
*** 150,158 ****
  	if (!in_ng) {
  	    for (s++; isdigit(*s); s++) ;
  	    while (isspace(*s)) s++;
! 	    moderated = (!*s || *s == 'y'
! 		? nullstr
! 		: getval("MODSTRING"," (moderated)") );
  	}
      }
  #endif
--- 166,183 ----
  	if (!in_ng) {
  	    for (s++; isdigit(*s); s++) ;
  	    while (isspace(*s)) s++;
! 	    switch (*s) {
! 	    case 'n': moderated = getval("NOPOSTRING"," (no posting)"); break;
! 	    case 'm': moderated = getval("MODSTRING", " (moderated)"); break;
! 	    /* This shouldn't even occur.  What are we doing in a non-existent
! 	       group?  Disallow it. */
! 	    case 'x': return TR_BOGUS;
! 	    /* what should be done about refiled groups?  rn shouldn't even
! 	       be in them (ie, if sci.aquaria is refiled to rec.aquaria, then
! 	       get the news there) */
! 	    case '=': return TR_BOGUS;
! 	    default: moderated = nullstr;
! 	    }
  	}
      }
  #endif
***************
*** 293,299 ****
  ART_NUM floor;
  {
      register DIR *dirp;
!     register struct direct *dp;
      register ART_NUM min = 1000000;
      register ART_NUM maybe;
      register char *p;
--- 318,324 ----
  ART_NUM floor;
  {
      register DIR *dirp;
!     register struct DIRTYPE *dp;
      register ART_NUM min = 1000000;
      register ART_NUM maybe;
      register char *p;
***************
*** 302,308 ****
      dirp = opendir(dirname);
      if (!dirp)
  	return 0;
!     while ((dp = readdir(dirp)) != Null(struct direct *)) {
  	if ((maybe = atol(dp->d_name)) < min && maybe > floor) {
  	    for (p = dp->d_name; *p; p++)
  		if (!isdigit(*p))
--- 327,333 ----
      dirp = opendir(dirname);
      if (!dirp)
  	return 0;
!     while ((dp = readdir(dirp)) != Null(struct DIRTYPE *)) {
  	if ((maybe = atol(dp->d_name)) < min && maybe > floor) {
  	    for (p = dp->d_name; *p; p++)
  		if (!isdigit(*p))
Index: ngstuff.c
Prereq: 4.3.1.2
*** ngstuff.c	Sun Apr 15 02:32:58 1990
--- ../rn/ngstuff.c	Sat Apr 14 22:22:40 1990
***************
*** 1,6 ****
! /* $Header: ngstuff.c,v 4.3.1.2 85/05/10 14:31:52 lwall Exp $
   *
   * $Log:	ngstuff.c,v $
   * Revision 4.3.1.2  85/05/10  14:31:52  lwall
   * Prevented "Junked" or "Marked unread" when no state change.
   * 
--- 1,10 ----
! /* $Header: ngstuff.c,v 4.3.2.2 90/04/14 19:40:02 sob Exp $
   *
   * $Log:	ngstuff.c,v $
+  * Revision 4.3.2.2  90/04/14  19:40:02  sob
+  * Fixed small syntax problem that generates errors with particular C
+  * preprocessors.
+  *
   * Revision 4.3.1.2  85/05/10  14:31:52  lwall
   * Prevented "Junked" or "Marked unread" when no state change.
   * 
***************
*** 69,75 ****
  	    sig_catcher(0);
  	}
      }
! #ifdef MAILCALL;
      mailcount = 0;			/* force recheck */
  #endif
      return 0;
--- 73,79 ----
  	    sig_catcher(0);
  	}
      }
! #ifdef MAILCALL
      mailcount = 0;			/* force recheck */
  #endif
      return 0;
Index: rcstuff.c
Prereq: 4.3.2.2
*** rcstuff.c	Sun Apr 15 02:32:35 1990
--- ../rn/rcstuff.c	Sat Apr 14 22:22:19 1990
***************
*** 1,6 ****
! /* $Header: rcstuff.c,v 4.3.2.2 89/11/26 18:22:26 sob Locked $
   *
   * $Log:	rcstuff.c,v $
   * Revision 4.3.2.2  89/11/26  18:22:26  sob
   * Added changes to addnewgroup() to cause rn to ask once and only once
   * to add a new group to .newsrc. 
--- 1,9 ----
! /* $Header: rcstuff.c,v 4.3.2.3 89/12/20 23:25:04 sob Exp $
   *
   * $Log:	rcstuff.c,v $
+  * Revision 4.3.2.3  89/12/20  23:25:04  sob
+  * Changed the maximum lenght of a newsgroup name from 20 to 40 characters.
+  * 
   * Revision 4.3.2.2  89/11/26  18:22:26  sob
   * Added changes to addnewgroup() to cause rn to ask once and only once
   * to add a new group to .newsrc. 
***************
*** 199,205 ****
  	    else {
  #ifdef VERBOSE
  		IF(verbose)
! 		    printf("Unread news in %-20s %5ld article%s\n",
  			rcline[newng],(long)toread[newng],
  			toread[newng]==TR_ONE ? nullstr : "s") FLUSH;
  		ELSE
--- 202,208 ----
  	    else {
  #ifdef VERBOSE
  		IF(verbose)
! 		    printf("Unread news in %-40s %5ld article%s\n",
  			rcline[newng],(long)toread[newng],
  			toread[newng]==TR_ONE ? nullstr : "s") FLUSH;
  		ELSE
Index: respond.c
Prereq: 4.3.2.2
*** respond.c	Sun Apr 15 02:32:47 1990
--- ../rn/respond.c	Sat Apr 14 22:22:31 1990
***************
*** 1,6 ****
! /* $Header: respond.c,v 4.3.2.2 89/11/26 18:25:10 sob Locked $
   *
   * $Log:	respond.c,v $
   * Revision 4.3.2.2  89/11/26  18:25:10  sob
   * Enlarged the size of the header buffer to accomodate long references lines.
   * Fix provided by Joe Buck.
--- 1,9 ----
! /* $Header: respond.c,v 4.3.2.3 90/03/22 23:05:19 sob Exp $
   *
   * $Log:	respond.c,v $
+  * Revision 4.3.2.3  90/03/22  23:05:19  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.2  89/11/26  18:25:10  sob
   * Enlarged the size of the header buffer to accomodate long references lines.
   * Fix provided by Joe Buck.
***************
*** 291,302 ****
  	 myuid != ROOTID ) )
  #ifdef VERBOSE
  	    IF(verbose)
! 		fputs("You can't cancel someone else's article\n",stdout)
  		  FLUSH;
  	    ELSE
  #endif
  #ifdef TERSE
! 		fputs("Not your article\n",stdout) FLUSH;
  #endif
      else {
  	tmpfp = fopen(headname,"w");	/* open header file */
--- 294,305 ----
  	 myuid != ROOTID ) )
  #ifdef VERBOSE
  	    IF(verbose)
! 		fputs("\nYou can't cancel someone else's article\n",stdout)
  		  FLUSH;
  	    ELSE
  #endif
  #ifdef TERSE
! 		fputs("\nNot your article\n",stdout) FLUSH;
  #endif
      else {
  	tmpfp = fopen(headname,"w");	/* open header file */
***************
*** 307,312 ****
--- 310,316 ----
  	interp(buf, (sizeof buf), getval("CANCELHEADER",CANCELHEADER));
  	fputs(buf,tmpfp);
  	fclose(tmpfp);
+ 	fputs("\nCanceling...\n",stdout) FLUSH;
  	r = doshell(sh,filexp(getval("CANCEL",CANCEL)));
      }
  no_cancel:
Index: rn.c
Prereq: 4.3.2.2
*** rn.c	Sun Apr 15 02:32:20 1990
--- ../rn/rn.c	Sat Apr 14 22:22:29 1990
***************
*** 9,17 ****
   *      RRN/RN: 11/01/89
  */
  
! static char rnid[] = "@(#)$Header: rn.c,v 4.3.2.2 89/11/28 01:51:25 sob Locked $";
  
  /* $Log:	rn.c,v $
   * Revision 4.3.2.2  89/11/28  01:51:25  sob
   * Removed redundant #include directive.
   * 
--- 9,24 ----
   *      RRN/RN: 11/01/89
  */
  
! static char rnid[] = "@(#)$Header: rn.c,v 4.3.2.4 90/04/03 23:11:33 sob Exp $";
! static char patchlevel[] = "Patch #: 45";
  
  /* $Log:	rn.c,v $
+  * Revision 4.3.2.4  90/04/03  23:11:33  sob
+  * Added more information to the version command.
+  * 
+  * Revision 4.3.2.3  90/03/22  23:05:23  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.2  89/11/28  01:51:25  sob
   * Removed redundant #include directive.
   * 
***************
*** 180,185 ****
--- 187,193 ----
  			ng++;		/* then skip it */
  			continue;
  		    }
+     reprompt_newsgroup:
  		    dfltcmd = "ynq";
  #ifdef VERBOSE
  		    IF(verbose)
***************
*** 483,490 ****
  			ng++;
  			break;
  		    case NG_ASK:
! 			dfltcmd = "ynq";
! 			goto reask_newsgroup;
  		    case NG_MINUS:
  			ng = recent_ng;	/* recall previous newsgroup */
  			special = TRUE;	/* don't skip it if toread==0 */
--- 491,497 ----
  			ng++;
  			break;
  		    case NG_ASK:
! 			goto reprompt_newsgroup;
  		    case NG_MINUS:
  			ng = recent_ng;	/* recall previous newsgroup */
  			special = TRUE;	/* don't skip it if toread==0 */
***************
*** 497,503 ****
  		    goto reask_newsgroup;
  #endif
  		case 'v':
! 		    printf("\n%s\n",rnid) FLUSH;
  		    goto reask_newsgroup;
  		default:
  		    printf("\n%s",hforhelp) FLUSH;
--- 504,512 ----
  		    goto reask_newsgroup;
  #endif
  		case 'v':
! 		    printf("\n%s",rnid);
! 		    printf("\n%s",patchlevel);
! 		    printf("\nSend bugs to rrn@lib.tmc.edu\n") FLUSH;
  		    goto reask_newsgroup;
  		default:
  		    printf("\n%s",hforhelp) FLUSH;
Index: search.c
Prereq: 4.3
*** search.c	Sun Apr 15 02:32:10 1990
--- ../rn/search.c	Sat Apr 14 22:22:13 1990
***************
*** 1,6 ****
! /* $Header: search.c,v 4.3 85/05/01 11:50:16 lwall Exp $
   *
   * $Log:	search.c,v $
   * Revision 4.3  85/05/01  11:50:16  lwall
   * Baseline for release with 4.3bsd.
   * 
--- 1,13 ----
! /* $Header: search.c,v 4.3.2.2 90/03/22 23:05:31 sob Exp $
   *
   * $Log:	search.c,v $
+  * Revision 4.3.2.2  90/03/22  23:05:31  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
+  * Revision 4.3.2.1  90/03/17  17:46:29  sob
+  * Added changes to insure that null search strings won't result in core dumps
+  * on non-VAX computers.
+  * 
   * Revision 4.3  85/05/01  11:50:16  lwall
   * Baseline for release with 4.3bsd.
   * 
***************
*** 367,373 ****
      register char *trt = trans;
      register int c;
   
!     if (addr == Nullch)
  	return Nullch;
      if (compex->nbra) {			/* any brackets? */
  	for (c = 0; c <= compex->nbra; c++)
--- 374,380 ----
      register char *trt = trans;
      register int c;
   
!     if (addr == Nullch || compex->expbuf == Nullch)
  	return Nullch;
      if (compex->nbra) {			/* any brackets? */
  	for (c = 0; c <= compex->nbra; c++)
Index: sw.c
Prereq: 4.3.2.1
*** sw.c	Sun Apr 15 02:32:48 1990
--- ../rn/sw.c	Sat Apr 14 22:22:32 1990
***************
*** 1,6 ****
! /* $Header: sw.c,v 4.3.2.1 89/12/09 00:52:40 sob Exp $
   *
   * $Log:	sw.c,v $
   * Revision 4.3.2.1  89/12/09  00:52:40  sob
   * Now handles SIGWINCH correctly.
   * 
--- 1,9 ----
! /* $Header: sw.c,v 4.3.2.2 90/03/22 23:05:34 sob Exp $
   *
   * $Log:	sw.c,v $
+  * Revision 4.3.2.2  90/03/22  23:05:34  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.1  89/12/09  00:52:40  sob
   * Now handles SIGWINCH correctly.
   * 
***************
*** 420,425 ****
--- 423,429 ----
  	printf("-S%d ",scanon);
      else
  	printf("+S ");
+ #endif
  #ifdef VERBOSE
  #ifdef TERSE
      printf("%ct ", mp[!verbose]);
***************
*** 428,434 ****
      printf("%cT ", mp[typeahead]);
  #ifdef VERIFY
      printf("%cv ", mp[verify]);
- #endif
  #endif
      fputs("\n\n",stdout) FLUSH;
  #ifdef ONLY
--- 432,437 ----
Index: term.c
Prereq: 4.3.2.3
*** term.c	Sun Apr 15 02:32:19 1990
--- ../rn/term.c	Sun Apr 15 02:55:05 1990
***************
*** 1,6 ****
! /* $Header: term.c,v 4.3.2.3 89/11/28 01:51:58 sob Locked $
   *
   * $Log:	term.c,v $
   * Revision 4.3.2.3  89/11/28  01:51:58  sob
   * Now handles SIGWINCH correctly.
   * 
--- 1,15 ----
! /* $Header: term.c,v 4.3.2.6 90/04/13 23:48:17 sob Exp $
   *
   * $Log:	term.c,v $
+  * Revision 4.3.2.6  90/04/13  23:48:17  sob
+  * Modifications provided by Gene Hackney for 3b2.
+  * 
+  * Revision 4.3.2.5  90/04/06  20:35:08  sob
+  * Added fixes for SCO Xenix sent by ronald@robobar.co.uk.
+  * 
+  * Revision 4.3.2.4  90/03/22  23:05:38  sob
+  * Fixes provided by Wayne Davison <drivax!davison>
+  * 
   * Revision 4.3.2.3  89/11/28  01:51:58  sob
   * Now handles SIGWINCH correctly.
   * 
***************
*** 134,144 ****
      char *s;
      int status;
  #ifdef TIOCGWINSZ
      struct winsize winsize;
  #endif
  
  #ifdef PENDING
! #ifndef FIONREAD
      /* do no delay reads on something that always gets closed on exit */
  
      devtty = open("/dev/tty",0);
--- 143,161 ----
      char *s;
      int status;
  #ifdef TIOCGWINSZ
+ #ifdef u3b2
+ struct winsize {
+ 	unsigned short ws_row;       /* rows, in characters*/
+ 	unsigned short ws_col;       /* columns, in character */
+ 	unsigned short ws_xpixel;    /* horizontal size, pixels */
+ 	unsigned short ws_ypixel;    /* vertical size, pixels */
+ };
+ #endif
      struct winsize winsize;
  #endif
  
  #ifdef PENDING
! #if ! defined (FIONREAD) && ! defined (RDCHK)
      /* do no delay reads on something that always gets closed on exit */
  
      devtty = open("/dev/tty",0);
***************
*** 295,301 ****
  	    garbage = 0;
  	if (s[1]) {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_STRING) {
! 		puts(override,stdout) FLUSH;
  		free(curmap->km_ptr[ch].km_str);
  		curmap->km_ptr[ch].km_str = Nullch;
  	    }
--- 312,318 ----
  	    garbage = 0;
  	if (s[1]) {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_STRING) {
! 		fputs(override,stdout) FLUSH;
  		free(curmap->km_ptr[ch].km_str);
  		curmap->km_ptr[ch].km_str = Nullch;
  	    }
***************
*** 306,312 ****
  	}
  	else {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_KEYMAP)
! 		puts(override,stdout) FLUSH;
  	    else {
  		curmap->km_type[ch] = KM_STRING + garbage;
  		curmap->km_ptr[ch].km_str = savestr(m);
--- 323,329 ----
  	}
  	else {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_KEYMAP)
! 		fputs(override,stdout) FLUSH;
  	    else {
  		curmap->km_type[ch] = KM_STRING + garbage;
  		curmap->km_ptr[ch].km_str = savestr(m);
***************
*** 593,599 ****
  }
  
  #ifdef PENDING
! #ifndef FIONREAD
  int
  circfill()
  {
--- 610,616 ----
  }
  
  #ifdef PENDING
! #if ! defined (FIONREAD) && ! defined (RDCHK)
  int
  circfill()
  {
***************
*** 733,741 ****
      for (;;) {
  	int_count = 0;
  	errno = 0;
! 	if (read_tty(whatbuf,1) < 0 && !errno)
! 	    errno = EINTR;
! 	if (errno && errno != EINTR) {
  	    perror(readerr);
  	    sig_catcher(0);
  	}
--- 750,759 ----
      for (;;) {
  	int_count = 0;
  	errno = 0;
! 	if (read_tty(whatbuf,1) < 0)
! 	    if (!errno)
! 	        errno = EINTR;
! 	    else {
  	    perror(readerr);
  	    sig_catcher(0);
  	}
***************
*** 846,851 ****
--- 864,870 ----
      else if (*tmpbuf != ' ' && *tmpbuf != '\n') {
  	carriage_return();
  	erase_eol();	/* erase the prompt */
+ 	carriage_return();
  	return *tmpbuf == 'q' ? -1 : *tmpbuf;
      }
      if (*tmpbuf == '\n') {
***************
*** 852,857 ****
--- 871,877 ----
  	page_line = LINES - 1;
  	carriage_return();
  	erase_eol();
+ 	carriage_return();
      }
      else {
  	page_line = 1;
***************
*** 860,865 ****
--- 880,886 ----
  	else {
  	    carriage_return();
  	    erase_eol();		/* erase the prompt */
+ 	    carriage_return();
  	}
      }
      return 0;
Index: term.h
Prereq: 4.3.2.1
*** term.h	Sun Apr 15 02:32:58 1990
--- ../rn/term.h	Sun Apr 15 02:55:05 1990
***************
*** 1,6 ****
! /* $Header: term.h,v 4.3.2.1 89/11/28 01:54:03 sob Locked $
   *
   * $Log:	term.h,v $
   * Revision 4.3.2.1  89/11/28  01:54:03  sob
   * Added better support for SIGWINCH.
   * 
--- 1,9 ----
! /* $Header: term.h,v 4.3.2.2 90/04/06 20:35:34 sob Exp $
   *
   * $Log:	term.h,v $
+  * Revision 4.3.2.2  90/04/06  20:35:34  sob
+  * Added fixes for SCO Xenix sent by ronald@robobar.co.uk.
+  * 
   * Revision 4.3.2.1  89/11/28  01:54:03  sob
   * Added better support for SIGWINCH.
   * 
***************
*** 28,33 ****
--- 31,39 ----
  #define input_pending() bizarre
  #endif lint
  #else FIONREAD
+ #ifdef RDCHK
+ #define input_pending() (rdchk(0) > 0)		/* boolean only */
+ #else /*  RDCHK */
  int circfill();
  EXT int devtty INIT(0);
  #ifndef lint
***************
*** 35,40 ****
--- 41,47 ----
  #else
  #define input_pending() bizarre
  #endif lint
+ #endif /* RDCHK */
  #endif FIONREAD
  #else PENDING
  #ifndef lint
***************
*** 56,61 ****
--- 63,72 ----
  
  #else FIONREAD
  
+ #ifdef RDCHK
+ #define input_pending() (rdchk(0) > 0)		/* boolean only */
+ #else /*  RDCHK */
+ 
  EXT int devtty INIT(0);
  EXT bool is_input INIT(FALSE);
  EXT char pending_ch INIT(0);
***************
*** 64,69 ****
--- 75,81 ----
  #else
  #define input_pending() bizarre
  #endif lint
+ #endif /*  RDCHK */
  #endif FIONREAD
  #else PENDING
  #define read_tty(addr,size) read(0,addr,size)
Index: util.c
Prereq: 4.3.2.4
*** util.c	Sun Apr 15 02:32:01 1990
--- ../rn/util.c	Sun Apr 15 01:38:43 1990
***************
*** 1,6 ****
! /* $Header: util.c,v 4.3.2.4 89/12/14 23:58:54 sob Exp $
   *
   * $Log:	util.c,v $
   * Revision 4.3.2.4  89/12/14  23:58:54  sob
   * Fixed small bug reported by fletcher@cs.utexas.edu in getwd().
   * 
--- 1,9 ----
! /* $Header: util.c,v 4.3.2.5 90/03/17 21:34:21 sob Exp $
   *
   * $Log:	util.c,v $
+  * Revision 4.3.2.5  90/03/17  21:34:21  sob
+  * Reworked VOIDSIG into SIGRET.
+  * 
   * Revision 4.3.2.4  89/12/14  23:58:54  sob
   * Fixed small bug reported by fletcher@cs.utexas.edu in getwd().
   * 
***************
*** 44,55 ****
  char *s, *shl;
  {
      int status, pid, w;
! #ifdef VOIDSIG
!     int mask;
! #else
!     register int (*istat)(), (*qstat)();
!     int (*signal())();
! #endif
      char *shell;
  
  #ifdef SIGTSTP
--- 47,53 ----
  char *s, *shl;
  {
      int status, pid, w;
!     SIGRET (*signal())();
      char *shell;
  
  #ifdef SIGTSTP
***************
*** 68,74 ****
  	/* This is necessary to keep bourne shell from puking */
  
          for (i = 3; i < 10; ++i)
!                 (void) close(i);
  #endif SERVER
  
  	if (*s)
--- 66,72 ----
  	/* This is necessary to keep bourne shell from puking */
  
          for (i = 3; i < 10; ++i)
!                 close(i);
  #endif SERVER
  
  	if (*s)
***************
*** 77,95 ****
  	    execl(shell, shell, Nullch, Nullch, Nullch);
  	_exit(127);
      }
- #ifdef VOIDSIG
-     mask = sigblock(0);
      signal(SIGINT, SIG_IGN);
      signal(SIGQUIT, SIG_IGN);
- #else
- #ifndef lint
-     istat = signal(SIGINT, SIG_IGN);
-     qstat = signal(SIGQUIT, SIG_IGN);
- #else
-     istat = Null(int (*)());
-     qstat = Null(int (*)());
- #endif lint
- #endif
      waiting = TRUE;
      while ((w = wait(&status)) != pid && w != -1)
  	;
--- 75,82 ----
***************
*** 96,109 ****
      if (w == -1)
  	status = -1;
      waiting = FALSE;
! #ifdef VOIDSIG
!     signal(SIGINT, SIG_DFL);
      signal(SIGQUIT, SIG_DFL);
-     sigsetmask(mask);
- #else
-     signal(SIGINT, istat);
-     signal(SIGQUIT, qstat);
- #endif
  #ifdef SIGTSTP
      sigset(SIGTSTP,stop_catcher);
      sigset(SIGTTOU,stop_catcher);
--- 83,90 ----
      if (w == -1)
  	status = -1;
      waiting = FALSE;
!     sigset(SIGINT, int_catcher);	/* always catch interrupts */
      signal(SIGQUIT, SIG_DFL);
  #ifdef SIGTSTP
      sigset(SIGTSTP,stop_catcher);
      sigset(SIGTTOU,stop_catcher);
***************
*** 267,357 ****
  /*
   * Get working directory
   */
! 
! #ifdef GETWD
! #define	dot	"."
! #define	dotdot	".."
! 
! static	char	*name;
! 
! static	DIR	*dirp;
! static	int	off;
! static	struct	stat	d, dd;
! static	struct	direct	*dir;
! 
  char *
  getwd(np)
  char *np;
  {
! 	long rdev, rino;
! 
! 	*np++ = '/';
! 	*np = 0;
! 	name = np;
! 	off = -1;
! 	stat("/", &d);
! 	rdev = d.st_dev;
! 	rino = d.st_ino;
! 	for (;;) {
! 		stat(dot, &d);
! 		if (d.st_ino==rino && d.st_dev==rdev)
! 			goto done;
! 		if ((dirp = opendir(dotdot)) == Null(DIR *))
! 			prexit("getwd: cannot open ..\n");
! 		stat(dotdot, &dd);
! 		chdir(dotdot);
! 		if(d.st_dev == dd.st_dev) {
! 			if(d.st_ino == dd.st_ino)
! 				goto done;
! 			do
! 				if ((dir = readdir(dirp)) == Null(struct direct *))
! 					prexit("getwd: read error in ..\n");
! 			while (dir->d_ino != d.st_ino);
! 		}
! 		else do {
! 				if ((dir = readdir(dirp)) == Null(struct direct *))
! 					prexit("getwd: read error in ..\n");
! 				stat(dir->d_name, &dd);
! 			} while(dd.st_ino != d.st_ino || dd.st_dev != d.st_dev);
! 		cat();
! 		closedir(dirp);
! 	}
! done:
! 	name--;
! 	if (chdir(name) < 0) {
! 		printf("getwd: can't cd back to %s\n",name) FLUSH;
! 		sig_catcher(0);
! 	}
! 	return (name);
  }
- 
- void
- cat()
- {
- 	register i, j;
- 
- 	i = -1;
- 	while (dir->d_name[++i] != 0);
- 	if ((off+i+2) > 1024-1)
- 		return;
- 	for(j=off+1; j>=0; --j)
- 		name[j+i+1] = name[j];
- 	if (off >= 0)
- 		name[i] = '/';
- 	off=i+off+1;
- 	name[off] = 0;
- 	for(--i; i>=0; --i)
- 		name[i] = dir->d_name[i];
- }
- 
- void
- prexit(cp)
- char *cp;
- {
- 	write(2, cp, strlen(cp));
- 	sig_catcher(0);
- }
  #else
  char *
  getwd(np)			/* shorter but slower */
  char *np;
--- 248,264 ----
  /*
   * Get working directory
   */
! #ifdef GETCWD
  char *
  getwd(np)
  char *np;
  {
!     char * name;
!     name = getcwd(np,1024);
!     return(name);
  }
  #else
+ #ifndef GETWD
  char *
  getwd(np)			/* shorter but slower */
  char *np;
***************
*** 369,375 ****
      return np;
  }
  #endif
! 
  /* just like fgets but will make bigger buffer as necessary */
  
  char *
--- 276,282 ----
      return np;
  }
  #endif
! #endif
  /* just like fgets but will make bigger buffer as necessary */
  
  char *

--
Stan           internet: sob@bcm.tmc.edu         Director, Networking 
Olan           uucp: {rutgers,mailrus}!bcm!sob   and Systems Support
Barber         Opinions expressed are only mine. Baylor College of Medicine
RN Patch #45, problems with signal()
#518
Author: Adri Verhoef
Date: Tue, 17 Apr 1990 21:55
41 lines
2030 bytes
I still have a problem with the declaration of signal().
When compiling, the compiler complains about a redeclaration of signal
in "util.c"; my system says that signal() is of type void*, not int*,
but Configure doesn't recognize this.
In /usr/include/signal.h it says:
	extern	void(*signal())();

My system is Uniq System V.3.0, it is derived from AT&T.

On the other hand we also have AT&T System V.2.0 (namely some 3B2s),
but *they* say that signal is int*; here, /usr/include/signal.h states:
	extern	(*signal())();

Maybe we should determine what type signal() is from signal.h?

Like this:
= cut here =
: default
sigret=int
: determine type of signal function
if [ -f /usr/include/signal.h ]
then
	WHITE='[	 ]'; : between the brackets are a tab and a space.
	if grep "$WHITE*void$WHITE*(\*signal())();" \
					/usr/include/signal.h >/dev/null
	then
		sigret=void
	fi
fi
= end =

It works for me on:			where it says:
	Ultrix 3.1				extern void	(*signal())();
	Uniq S5R3.0				extern	void(*signal())();
	AT&T S5R2.0				extern	(*signal())();
	SCO Xenix S5R2.3.1			extern	(*signal())();
	Alliant Concentrix 5.0.0		int	(*signal())();
	SunOS 4.0_Export			void	(*signal())();
--
Adri Verhoef (a3@rivm.UUCP), News Administrator RIVM.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads