davison%borla@kithrup.com (01/20/91)
Here is patch #2 for trn (producing v1.0.2). Part 1 of 2 ** Please apply ** To extract this from trn, type "e dir" where dir is the directory you want the patch placed. Otherwise, delete everything through the first cut line and run it through sh. After unpacking part 2 of this patch in a similar manner, follow the directions in the file patch2a. -- \ /| / /|\/ /| /(_) Wayne Davison (_)/ |/ /\|/ / |/ \ 0004475895@mcimail.com (preferred) (W A Y N e) davison@dri.com (...!uunet!drivax!davison) ----8<------8<------8<------8<-----cut here----->8------>8------>8------>8---- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # unipatch.c # patch2a # This archive created: Fri Jan 19 20:00:42 1991 export PATH; PATH=/bin:/usr/bin:$PATH echo shar: "extracting 'unipatch.c'" '(1358 characters)' if test -f 'unipatch.c' then echo shar: "will not over-write existing file 'unipatch.c'" else cat << \SHAR_EOF > 'unipatch.c' /* A filter to turn a unidiff into a degenerate context diff (no '!'s) for patch. Author: davison@dri.com (uunet!drivax!davison). */ #include <stdio.h> #define ERR(a) {fputs(a,stderr);exit(1);} struct Ln { struct Ln *lk; char t; char s[1]; } r,*h,*ln; char *malloc(); main() { char bf[2048],*cp,ch; long os,ol,ns,nl,ne,lncnt=0; for(;;){ for(;;){ if(!fgets(bf,sizeof bf,stdin)) exit(0); lncnt++; if(!strncmp(bf,"@@ -",4)) break; fputs(bf,stdout); } if(sscanf(bf+4,"%ld,%ld +%ld,%ld %c",&os,&ol,&ns,&nl,&ch)!=5||ch!='@') goto bad; r.lk=0, h= &r, ne=ns+nl-1; printf("***************\n*** %ld,%ld ****\n",os,os+ol-(os>0)); while(ol||nl){ if(!fgets(bf,sizeof bf,stdin)){ if(nl>2) ERR("Unexpected end of file.\n"); strcpy(bf," \n"); } lncnt++; if(*bf=='\t'||*bf=='\n') ch=' ', cp=bf; else ch= *bf, cp=bf+1; switch(ch){ case'-':if(!ol--) goto bad; printf("- %s",cp); break; case'=':ch=' '; case' ':if(!ol--) goto bad; printf(" %s",cp); case'+':if(!nl--) goto bad; ln = (struct Ln*)malloc(sizeof(*ln)+strlen(cp)); if(!ln) ERR("Out of memory!\n"); ln->lk=0, ln->t=ch, strcpy(ln->s,cp); h->lk=ln, h=ln; break; default: bad: fprintf(stderr,"Malformed unidiff at line %ld: ",lncnt); ERR(bf); } } printf("--- %ld,%ld ----\n",ns,ne); for(ln=r.lk;ln;ln=h){ printf("%c %s",ln->t,ln->s); h=ln->lk; free(ln); } } } SHAR_EOF fi echo shar: "extracting 'patch2a'" '(62588 characters)' if test -f 'patch2a' then echo shar: "will not over-write existing file 'patch2a'" else cat << \SHAR_EOF > 'patch2a' Trn patch #2 PART 1 OF 2. To apply this patch you must either have patch version 12u (or above) or use the filter "unipatch" (included). You can get the latest version of patch from prep.ai.mit.edu (pub/gnu/patch-2.0.12u2.tar.Z), gatekeeper.dec.com, osu-cis, uunet (~/gnu/patch-2.0.12u2.tar.Z), etc, or you can mail me for diffs to convert patch v12 to patch v12u2. Those wishing to create their own unidiffs can grab gnudiff v1.15 from their favorite archive, or a "unify" conversion utility from me. To apply this patch without an upgraded version of patch, put unipatch.c, patch2a and patch2b into the same directory as your trn source. Then type: cc -o unipatch unipatch.c to compile unipatch. Finally, use it to pipe the patch files to patch: cat patch2a patch2b | unipatch | patch This patch includes all the changes made in rn patches 48 through 54 that weren't already in trn. (Thanx Guy Harris!) It also fixes a few bugs: o Fixed the endless writing to the log file in certain exception- handling circumstances. This is usually caused by a corrupt thread file. If mthreads has to abort, it will output the last group it was processing to the log file so that you can manually remove the offending thread file if needed. See also the -z option. o Fixed an mthreads daemon problem where a shrinking active file would cause active2 to be truncated on each following pass. o Fixed an mthreads bug that got the high/low counts wrong for groups not yet in the active2 file. This could cause a delay in the creation of thread files for new groups until more articles arrived for it. o Enhanced Configure to check for tzset/timezone in a better manner. The confirmation prompts for this are also better. There are also a couple new options for mthreads: -s causes it to sleep one second between each article it processes (-ss sleeps two seconds, etc), and -z tells mthreads to 'zap' (erase) a thread file that it believes to be corrupted. It is also possible to get each group's name put into the log file for debugging (-D) or to be very verbose (-vvvv). I've also included a few portability changes from my dos port (in progress) that I thought would be worth while. If anyone is interested in running trn under dos, I have mthreads working and trn reading news, but no replies or file saves (both done with pesky shell files). Contact me if you'd like to help port/test and I'll send you a diff of changes. You must already posses trn v1.0.2 (the result of this patch) or get it from somewhere else. Finally, a special thanks to those of you who have sent me bug reports and fixes for trn. I appreciate your input AND your patience in the last few months. Enjoy! -- \ /| / /|\/ /| /(_) Wayne Davison (_)/ |/ /\|/ / |/ \ 0004475895@mcimail.com (preferred) (W A Y N e) davison@dri.com (...!uunet!drivax!davison) Index: patchlevel Prereq: v1.0.1 @@ -1,1 +1,1 @@ -Trn v1.0.1 +Trn v1.0.2 Index: Configure @@ -4,7 +4,10 @@ =# shell scripts, Configure will trim # comments from them for you. =# -# $Header: Configure,v 4.3.3.2 90/08/20 16:09:59 davison Trn $ +# $Header: Configure,v 4.3.3.3 91/01/16 02:00:36 davison Trn $ =# =# $Log: Configure,v $ +# Revision 4.3.3.3 91/01/16 02:00:36 davison +# Integrated rn patches 48-54 and tweaked sitename handling. +# =# Revision 4.3.3.2 90/08/20 16:09:59 davison =# Added MMDF support, revised sitename/domain/signal/tzset/PATH. @@ -13,4 +16,48 @@ =# Initial Trn Release =# +# Revision 4.3.2.37 90/12/30 03:46:54 sob +# Changed "hidden" to "hiddennet" to be like nntp and bnews. +# Made it possible to cancel articles if hiddennet is defined. +# +# Revision 4.3.2.36 90/12/30 03:31:17 sob +# Better NeXT support and some other problems corrected. +# +# Revision 4.3.2.35 90/12/04 02:51:20 sob +# Removed redundant "addcflags" label +# +# Revision 4.3.2.34 90/11/22 17:49:31 sob +# Fixed bug in "hidden" code. +# +# Revision 4.3.2.33 90/11/22 13:42:44 sob +# Added support for the Uniq System V.3 OS (courtesy of a3@rivm.nl & +# frans@rivm.nl). +# Added support for making all mail and news appear to come from the domain +# itself instead of individual hosts within a domain. +# +# Revision 4.3.2.32 90/11/22 13:30:37 sob +# Fixes to make using the supplied ndir.c work correctly. +# Fixes to make building rn on an Apollo work correctly. +# +# Revision 4.3.2.31 90/11/10 00:08:08 sob +# This one appears to work for Interactive Unix. +# +# Revision 4.3.2.30 90/11/09 23:29:16 sob +# Added a few line for making rrn under Interactive Unix easier. +# +# Revision 4.3.2.29 90/11/05 23:26:21 sob +# Added detection of /usr/include/sys/ptem.h for more recent versions +# of System V. +# +# Revision 4.3.2.28 90/11/04 03:35:01 sob +# Added better detection for getwd() and getcwd(). This will hopefully be +# the last hurrah of this problem (naive, aren't I?) +# +# Revision 4.3.2.27 90/10/06 11:54:56 sob +# Added check for memcpy/bcopy. +# +# Revision 4.3.2.26 90/10/01 01:39:43 sob +# Altered the FLAGS for SCO Xenix 286. The old one are commented out. Let's +# see if this works better. +# =# Revision 4.3.2.25 90/05/12 17:34:53 sob =# Still more XENIX fixes and fixes for using socketlib when rrn and not when @@ -146,4 +193,5 @@ =grep='' =egrep='' +nidump='' =ypmatch='' =contains='' @@ -201,5 +249,4 @@ =truncate='' =chsize='' -sysptem='' =tzset='' =threaddef='' @@ -216,4 +263,5 @@ =fcntl='' =ioctl='' +ptem='' =normsig='' =sigblock='' @@ -221,4 +269,5 @@ =getuidgid='' =getcwd='' +getwd='' =havetlib='' =getpwent='' @@ -233,4 +282,5 @@ =NNTPSRC='' =CONFIG='' +hiddennet='' = =echo "Beginning of configuration questions for trn." @@ -325,5 +375,5 @@ =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 trn without having run -Configure is well nigh impossible.) Also, tell Wayne (davison@drivax.UUCP) +Configure is well nigh impossible.) Also, tell Wayne (davison@dri.com) =how he blew it. = @@ -336,4 +386,6 @@ =echo $n "[Type carriage return to continue] $c" =. myread +Xn=$n +Xc=$c =: get old answers, if there is a config file out there =if test -f config.sh; then @@ -340,6 +392,8 @@ = echo " " = echo "(Fetching default answers from your old config.sh file...)" - . config.sh + . ./config.sh =fi +n=$Xn +c=$Xc = =: get list of predefined functions in a handy place @@ -357,15 +411,22 @@ = libc=/usr/lib/libc.a = else - if test -f "$libc"; then - echo "Your C library is in $libc, like you said before." + if test -f /lib/clib; then + echo "Your C library is in /lib/clib. How nonstandard, must be Apollo." + libc=/lib/clib = else - cat <<'EOM' + if test -f "$libc"; then + echo "Your C library is in $libc, like you said before." + else + cat <<'EOM' = =I can't seem to find your C library. I've looked for /lib/libc.a and -/usr/lib/libc.a, but neither of those are there. What is the full name +/usr/lib/libc.a, but neither of those are there. Perhaps you can find +out by reading `man 3 intro' if you have the 'man' facility installed. + =EOM - echo $n "of your C library? $c" - . myread - libc="$ans" + echo $n "What is the full name of your C library? $c" + . myread + libc="$ans" + fi = fi = fi @@ -374,10 +435,20 @@ =echo " " =echo $n "Extracting names from $libc for later perusal...$c" -if ar t $libc > libc.list; then +if ar t $libc >libc.list 2>/dev/null; then = echo "done" =else - echo " " - echo "The archiver doesn't think $libc is a reasonable library." - exit 1 + if test $libc = /lib/clib; then + if nm -g $libc | sed -e 's/$/.o/' >libc.list; then + echo "done" + else + echo " " + echo "Apparently $libc is not an object module. Try again." + exit 1 + fi + else + echo " " + echo "The archiver doesn't think $libc is a reasonable library." + exit 1 + fi =fi =: make some quick guesses about what we are up against @@ -384,5 +455,5 @@ =echo " " =echo $n "Hmm... $c" -if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then +if $contains sigvec.o libc.list >/dev/null 2>&1 ; then = echo "Looks kind of like a BSD system, but we'll see..." = echo exit 0 >bsd @@ -390,11 +461,10 @@ = echo exit 1 >v7 =else - if $contains SIGTSTP /usr/include/sys/signal.h >/dev/null 2>&1 ; then - echo "Looks sort of like a BSD system, but we'll see..." - echo exit 0 >bsd + if $contains dup2.o libc.list >/dev/null 2>&1 ; then + echo "Looks sort of like a V7 system, but we'll see..." + echo exit 1 >bsd = echo exit 1 >usg - echo exit 1 >v7 + echo exit 0 >v7 = else - if $contains fcntl.o libc.list >/dev/null 2>&1 ; then = echo "Looks kind of like a USG system, but we'll see..." = echo exit 1 >bsd @@ -401,11 +471,12 @@ = echo exit 0 >usg = echo exit 1 >v7 - else - echo "Looks kind of like a version 7 system, but we'll see..." - echo exit 1 >bsd - echo exit 1 >usg - echo exit 0 >v7 - fi = fi +fi +: +if test -f /etc/inittab; then + echo "You have an inittab file. You must be a USG system!" + echo exit 1 >bsd + echo exit 0 >usg + echo exit 1 >v7 =fi =if $contains vmssystem.o libc.list >/dev/null 2>&1 ; then @@ -599,4 +670,21 @@ =fi = +: check for NeXT +cat <<'EOT' >next.c +#ifdef NeXT +exit 0 +#else +exit 1 +#endif +EOT +$cpp next.c | grep exit >next +chmod 755 next +$eunicefix next +rm next.c +if next; then + echo "My, you really ARE on a NeXT." + addcflags='-bsd' +fi + =if bsd; then = getuidgid=define @@ -605,4 +693,28 @@ =fi = +cat <<'EOT' > s5uniq +if test -f /bin/uname +then + case `uname -r -m` in + "5.3 vax-"*) + if [ -f /usr/lib/libnet.a \ + -a -f /usr/lib/libhdb.a \ + -a -f /usr/lib/libbbn.a \ + -a -f /usr/lib/libstr.a ] + then + exit 0 + fi;; + esac +fi +exit 1 +EOT +chmod 755 s5uniq +if s5uniq; then + echo "This looks like Uniq. What a pity." + socketlib="-lnet -lhdb -lbbn -lstr" + rrninclude="-DR_UNIQ -DUSG" + # -DR_UNIQ and -DUSG are needed for ~nntp/common/clientlib.c +fi + =: see if sh knows # comments =echo " " @@ -697,5 +809,5 @@ =$eunicefix loc =loclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep" -trylist="test inews egrep more pg Mcc ypmatch" +trylist="test inews egrep more pg Mcc nidump ypmatch" =for file in $loclist; do = xxx=`loc $file $file $pth` @@ -779,4 +891,5 @@ = if $test $status -ne 0 ; then = $echo "YP installed, but not operational. We won't use it." + ypmatch="" = else = $echo "YP installed and operational." @@ -785,4 +898,7 @@ = ;; =esac +if $test "$nidump" = "nidump"; then + nidump="" +fi =if $test "$ypmatch" = "ypmatch"; then = ypmatch="" @@ -837,4 +953,6 @@ = if $test "$ypmatch" != ""; then = dir=\`$ypmatch \$name passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/"'\` + elif $test "$nidump" != ""; then + dir=\`$nidump passwd / | $sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\` = fi = if $test "\$dir" = ""; then @@ -895,5 +1013,5 @@ =$echo 'Maybe "hostname" will work...' =if ans=`sh -c hostname 2>&1` ; then - sitename=$ans + thissite=$ans = hostcmd=hostname =else @@ -900,5 +1018,5 @@ = $echo 'No, maybe "uuname -l" will work...' = if ans=`sh -c 'uuname -l' 2>&1` ; then - sitename=$ans + thissite=$ans = hostcmd='uuname -l' = else @@ -905,5 +1023,5 @@ = $echo 'Strange. Maybe "uname -n" will work...' = if ans=`sh -c 'uname -n' 2>&1` ; then - sitename=$ans + thissite=$ans = hostcmd='uname -n' = else @@ -910,5 +1028,5 @@ = $echo 'Oh well, maybe I can mine it out of whoami.h...' = if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then - sitename=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'` + thissite=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'` = hostcmd="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h" = else @@ -917,5 +1035,7 @@ = hostcmd='' = ;; - *) $echo "Well, you said $sitename before...";; + *) $echo "Well, you said $sitename before..." + thissite="$sitename" + ;; = esac = fi @@ -924,11 +1044,11 @@ =fi =: you do not want to know about this -set $sitename -sitename=$1 +set $thissite +thissite=$1 = =: translate upper to lower case. This is mostly to help UUCP work right. -case $sitename in +case $thissite in = *[A-Z]*) - sitename=`$echo $sitename | tr '[A-Z]' '[a-z]'` + thissite=`$echo $thissite | tr '[A-Z]' '[a-z]'` = $echo "(Normalizing case in your site name)" = ;; @@ -936,12 +1056,15 @@ = =: verify site name and allow them to override it -if $test "$sitename" ; then - $echo 'Your site name appears to be "'$sitename'".' +if $test "$thissite" ; then + $echo 'Your site name appears to be "'$thissite'".' =else - sitename='unknown' + thissite='unknown' =fi =case "$hostfile" in =/*) dflt="$hostfile" ;; -*) dflt="$sitename" ;; +*) case "$sitename" in + '') dflt="$thissite" ;; + *) dflt="$sitename" ;; + esac =esac =$cat <<'EOM' @@ -974,5 +1097,6 @@ = ;; = *) hostfile='' - if $test "X$sitename" = "X$ans" ; then + if $test "X$thissite" = "X$ans" ; then + sitename="$thissite" = $echo "Using the site name derived by $hostcmd: $sitename." = else @@ -994,5 +1118,23 @@ =fi = -: get organizaton name +case $hiddennet in +define) dflt=y;; +*) dflt=n;; +esac +$echo "Do you want your site ($sitename) to be hidden in" +$echo $n "domain '$domain'? [$dflt] $c" +. myread +case $ans in + '') ans=$dflt ;; +esac +case $ans in +y*) hiddennet=define + sitename=$domain + ;; +*) hiddennet=undef + ;; +esac + +: get organization name =longshots='/usr/src/new /usr/src/local /usr/local/src' =case "$orgname" in @@ -1197,5 +1339,5 @@ = *) = $echo " " - case "$usgname" in + case "$usgnam" in = define) = dflt=y;; @@ -1334,10 +1476,11 @@ =fi = -: check for tzset. +: check for S5-style timezone handling - current offset from GMT in +: external variable "timezone" rather than gotten with "ftime". =$echo " " -if $contains tzset libc.list >/dev/null 2>&1 || - $contains mktime libc.list >/dev/null 2>&1 || - $contains tzset /usr/include/time.h >/dev/null 2>&1 ; then - $echo "Your system appears to use tzset() rather than ftime()." +if $contains tzname /usr/include/time.h >/dev/null 2>&1 ; then + $echo "Your system appears to get the current timezone's offset" + $echo "from GMT from the external variable timezone rather than" + $echo "by calling ftime() or gettimeofday()." = $echo $n "Is this correct? [y] $c" = . myread @@ -1347,5 +1490,7 @@ = esac =else - $echo "Your system appears to use ftime() rather than tzset()." + $echo "Your system appears to get the current timezone's offset" + $echo "from GMT by calling ftime() or gettimeofday() rather than" + $echo "from the external variable timezone." = $echo $n "Is this correct? [y] $c" = . myread @@ -1368,5 +1513,5 @@ =so the first character is F. On other systems there are magic cookies like =control codes between articles, so one of those would be first. For example, -MMDF messages are seperated with lines of 4 control-A's. On your system, if a +MMDF messages are separated with lines of 4 control-A's. On your system, if a =EOM =$echo $n "file is in mailbox format, what is the first character of that file? [$dflt] $c" @@ -1475,12 +1620,4 @@ =fi = -: check for a ptem file -if $test -r /usr/include/sys/ptem.h ; then - sysptem=define - $echo "ptem.h found." -else - sysptem=undef -fi - =: see if this is a termio system =ultrix ; ultrix=$? @@ -1518,4 +1655,12 @@ =fi = +: see if ptem.h exists +if $test -r /usr/include/sys/ptem.h ; then + ptem=define + $echo "sys/ptem.h found." +else + ptem=undef +fi + =: see if the system has sigblock =if $contains sigblock.o libc.list >/dev/null 2>&1 ; then @@ -1530,4 +1675,5 @@ = $echo "getwd() found." = getcwd=undef + getwd=define =else =: see if the system has getcwd @@ -1535,6 +1681,8 @@ = $echo "getcwd() found." = getcwd=define + getwd=undef =else = getcwd=undef + getwd=undef =fi =fi @@ -1545,6 +1693,11 @@ = novfork='undef' =else - $echo "No vfork() found--will use fork() instead." - novfork='define' + if next; then + $echo "I know NeXTs have vfork()!" + novfork='undef' + else + $echo "No vfork() found--will use fork() instead." + novfork='define' + fi =fi = @@ -1694,5 +1847,6 @@ = iandd="-M3e" = else - iandd="-M2let8 -LARGE -F 3000" +: iandd="-M2let8 -LARGE -F 3000" + iandd="-Ml2et32 -LARGE -F B000" = fi = jobslib=-lx @@ -1707,4 +1861,8 @@ =fi =fi +: No Steve jokes... +if next; then + jobslib='-lsys_s' +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 @@ -1903,7 +2061,8 @@ = =done -: hack for Unisys NET-5000 +: hack for Unisys NET-5000 and Interactive V/386 =case "$isrrn" in =define) +: NET-5000 = if $test -d /usr/include/NET-5000 ; then = $echo "I sense you are on a Unisys 5000 computer...poor soul." @@ -1911,4 +2070,9 @@ = socketlib=-lsocket = fi +: Interactive Unix + if $test -f /usr/lib/libinet.a ; then + rrninclude="-DUSG" + socketlib=-linet + fi = ;; =*) ;; @@ -2189,5 +2353,9 @@ = mailer=$libexp/recmail = else - mailer=/bin/mail + if s5uniq && $test -f /usr/bin/mailx; then + mailer=/usr/bin/mailx + else + mailer=/bin/mail + fi = fi = fi @@ -2479,4 +2647,5 @@ =grep='$grep' =egrep='$egrep' +nidump='$nidump' =ypmatch='$ypmatch' =contains='$contains' @@ -2492,4 +2661,5 @@ =socketlib='$socketlib' =getcwd='$getcwd' +getwd='$getwd' =dirtype='$dirtype' =ndirlib='$ndirlib' @@ -2535,5 +2705,4 @@ =truncate='$truncate' =chsize='$chsize' -sysptem='$sysptem' =tzset='$tzset' =threaddef='$threaddef' @@ -2550,4 +2719,5 @@ =fcntl='$fcntl' =ioctl='$ioctl' +ptem='$ptem' =normsig='$normsig' =sigblock='$sigblock' @@ -2567,4 +2737,5 @@ =CONFIG=true =CTRLA='$CTRLA' +hiddennet='$hiddennet' =EOT = @@ -2615,5 +2786,5 @@ =$usehostfile#define HOSTFILE "$hostfile" = -/* OURDOMAIN is added to the site name if no "." is in it. */ +/* domain name for the site */ =#define OURDOMAIN "$domain" = @@ -2678,5 +2849,4 @@ =#$truncate TRUNCATE /* is truncate() available? */ =#$chsize CHSIZE /* is chsize() available? */ -#$sysptem SYS_PTEM /* is /usr/include/sys/ptem.h needed? */ =#$tzset TZSET /* modern timezone functions? */ =$novoid#define void int /* is void to be avoided? */ @@ -2685,4 +2855,5 @@ =#$eunice VMS /* not currently used, here just in case */ =#$getcwd GETCWD /* do we have getcwd()? */ +#$getwd GETWD /* do we have getwd()? */ =#$usendir USENDIR /* include ndir.c? */ =#$libndir LIBNDIR /* include /usr/include/ndir.h? */ @@ -2704,4 +2875,5 @@ =#$fcntl FCNTL /* should we include fcntl.h? */ =#$ioctl IOCTL /* are ioctl args all defined in one place? */ +#$ptem PTEM /* has the ptem.h include file ? */ =#$normsig NORMSIG /* use signal rather than sigset? */ =#$sigblock SIGBLOCK /* use sigblock and sigsetmask */ @@ -2717,4 +2889,5 @@ =#$isrrn SERVER /* rrn server code */ =$isrrn2#define SERVER_FILE "$serverfile" /* news server file */ +#$hiddennet HIDDENNET /* hide the host inside the domain? */ =EOT = Index: addng.c @@ -1,5 +1,8 @@ -/* $Header: addng.c,v 4.3.3.2 90/08/20 16:27:06 davison Trn $ +/* $Header: addng.c,v 4.3.3.3 91/01/16 02:20:43 davison Trn $ = * = * $Log: addng.c,v $ + * Revision 4.3.3.3 91/01/16 02:20:43 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.2 90/08/20 16:27:06 davison = * Allow breaking out of ng adding. Don't add 'X'ed groups. @@ -8,10 +11,13 @@ = * Initial Trn Release = * + * Revision 4.3.2.6 90/11/22 16:06:35 sob + * Changes to make pickly C preprocessors happier. + * + * Revision 4.3.2.5 90/09/04 23:29:51 sob + * Added fix for bithof() from bug report by kwthomas@nsslsun.gcn.uoknor.edu + * = * 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 @@ -68,5 +74,5 @@ = long birthof(); = - tmpname = savestr(filexp("/tmp/rnew.%$")); + tmpname = savestr(filexp(RNEWNAME)); = tmpfp = fopen(tmpname,"w"); = if (tmpfp == Nullfp) { @@ -78,4 +84,7 @@ = if (int_count) { = int_count = 0; + fclose(tmpfp); + UNLINK(tmpname); + free(tmpname); = return FALSE; = } @@ -151,12 +160,11 @@ =#ifdef SERVER = int x,tot,min,max; - if (ngsize < 2) { - sprintf(tst,"GROUP %s",ngnam); - put_server(tst); - (void) get_server(tst, sizeof(tst)); - if (*tst != CHAR_OK) return(0); /* not a real group */ - (void) sscanf(tst,"%d%d%d%d",&x,&tot,&min,&max); - if (tot == 1 && min == 1 && max == 1) return(time(Null(long *))); - } else return(0); + sprintf(tst,"GROUP %s",ngnam); + put_server(tst); + (void) get_server(tst, sizeof(tst)); + if (*tst != CHAR_OK) return(0); /* not a real group */ + (void) sscanf(tst,"%d%d%d%d",&x,&tot,&min,&max); + if (tot > 0) return(time(Null(long *))); + else return(0); =#else /* not SERVER */ = Index: addng.h @@ -1,5 +1,8 @@ -/* $Header: addng.h,v 4.3 85/05/01 11:34:48 lwall Exp $ +/* $Header: addng.h,v 4.3.3.1 91/01/16 02:20:45 davison Trn $ = * = * $Log: addng.h,v $ + * Revision 4.3.3.1 91/01/16 02:20:45 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:34:48 lwall = * Baseline for release with 4.3bsd. @@ -7,8 +10,8 @@ = */ = -void addng_init(); +void addng_init ANSI((void)); =#ifdef FINDNEWNG - bool newlist(); - long birthof(); - bool scanactive(); + bool newlist ANSI((bool,bool)); + long birthof ANSI((char *,ART_NUM)); + bool scanactive ANSI((void)); =#endif Index: art.c @@ -1,5 +1,8 @@ -/* $Header: art.c,v 4.3.3.2 90/08/20 16:05:33 davison Trn $ +/* $Header: art.c,v 4.3.3.3 91/01/16 02:20:45 davison Trn $ = * = * $Log: art.c,v $ + * Revision 4.3.3.3 91/01/16 02:20:45 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.2 90/08/20 16:05:33 davison = * Fixed bug in backpage code. @@ -8,4 +11,23 @@ = * Initial Trn Release = * + * Revision 4.3.2.9 90/12/10 01:34:42 sob + * "8 bit clean" mods and fixes for rn -e -L problems. + * + * Revision 4.3.2.8 90/12/04 02:49:12 sob + * Added long lost commands control-P and control-N back into rn. + * + * Revision 4.3.2.7 90/11/22 13:48:59 sob + * Added changes that will hopefully fix the "long lines" bug. + * + * Revision 4.3.2.6 90/10/01 21:14:36 sob + * Shifted to fileno to increase portability. + * + * Revision 4.3.2.5 90/10/01 21:05:22 sob + * Removed an extra closing paren. + * + * Revision 4.3.2.4 90/10/01 02:01:53 sob + * Fix provided by earle@sun.com to alter rn's assumption of how to turn + * off underline mode when at the end of a line. + * = * Revision 4.3.2.3 90/04/21 14:43:27 sob = * Revised previous patch insure that it does not decrement below zero. @@ -115,4 +137,5 @@ = bool notesfiles = FALSE; /* might there be notesfiles junk? */ = char oldmode = mode; + char *ctime(); = =#ifdef INNERSEARCH @@ -120,5 +143,6 @@ =#endif = - if (fstat(artfp->_file,&filestat)) +/* if (fstat(artfp->_file,&filestat)) ... does not work on Apollos */ + if (fstat(fileno(artfp),&filestat)) = /* get article file stats */ = return DA_CLEAN; @@ -202,5 +226,5 @@ = printf(" (%ld more",(long)i); = if (dmcount) - printf(" + %ld Marked to return)",(long)dmcount); + printf(" + %ld Marked to return",(long)dmcount); = putchar(')'); = } @@ -387,5 +411,5 @@ = for (outpos = 0; outpos < COLS; ) { = /* while line has room */ - if (*bufptr >= ' ') { /* normal char? */ + if (*(unsigned char *)bufptr >= ' ') { /* normal char? */ =#ifdef ULSMARTS = if (*bufptr == '_') { @@ -532,11 +556,13 @@ = } =#ifdef CLEAREOL -/* #ifdef INNERSEARCH - if (outputok) +#ifdef INNERSEARCH + if (outputok) =#endif - maybe_eol(); */ /* comment this out for now - until I am sure it is - needed*/ - + { + /* force movement onto the new line so CE will work */ + putchar(' '); + backspace(); + maybe_eol(); + } =#endif /* CLEAREOL */ = } @@ -599,4 +625,7 @@ = printf("--MORE--(%ld%%)",(long)(artpos*100/artsize)); = un_standout(); /* leave standout mode */ +#ifdef CLEAREOL + maybe_eol(); +#endif = fflush(stdout); =/* reinp_pager: /* unused, commented for lint */ @@ -910,5 +939,5 @@ = reread = FALSE; = do_hiding = TRUE; - if (index("nNpP",*buf) == Nullch && + if (index("nNpP\016\018",*buf) == Nullch && = index("wWsSe:!&|/?123456789.",*buf) != Nullch) { = setdfltcmd(); @@ -941,4 +970,7 @@ = =#endif /* CLEAREOL */ + carriage_return(); /* Resets kernel's tab column counter to 0 */ + fflush(stdout); + = if (*blinebeg != '\f' =#ifdef CUSTOMLINES Index: art.h @@ -1,5 +1,8 @@ -/* $Header: art.h,v 4.3 85/05/01 11:35:29 lwall Exp $ +/* $Header: art.h,v 4.3.3.1 91/01/16 02:20:48 davison Trn $ = * = * $Log: art.h,v $ + * Revision 4.3.3.1 91/01/16 02:20:48 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:35:29 lwall = * Baseline for release with 4.3bsd. @@ -14,6 +17,6 @@ =#define DA_TOEND 3 = -void art_init(); -int do_article(); -int page_switch(); -bool innermore(); +void art_init ANSI((void)); +int do_article ANSI((void)); +int page_switch ANSI((void)); +bool innermore ANSI((void)); Index: artio.c @@ -1,5 +1,8 @@ -/* $Header: artio.c,v 4.3.3.2 90/08/20 16:25:50 davison Trn $ +/* $Header: artio.c,v 4.3.3.3 91/01/16 02:20:48 davison Trn $ = * = * $Log: artio.c,v $ + * Revision 4.3.3.3 91/01/16 02:20:48 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.2 90/08/20 16:25:50 davison = * Fixed bug in artopen ==> nntpopen interaction. @@ -8,4 +11,7 @@ = * Initial Trn Release = * + * Revision 4.3.2.6 90/11/22 16:06:57 sob + * Changes to make pickly C preprocessors happier. + * = * Revision 4.3.2.5 90/03/22 23:04:04 sob = * Fixes provided by Wayne Davison <drivax!davison> @@ -74,5 +80,5 @@ = char *s; = - if (fstat(artfp->_file,&filestat)) + if (fstat(fileno(artfp),&filestat)) = return artfp; = if (filestat.st_size < (sizeof tmpbuf)) { @@ -100,5 +106,5 @@ = =#ifdef SERVER -static long our_pid; +static long our_pid=0; = =FILE * Index: artio.h @@ -1,5 +1,8 @@ -/* $Header: artio.h,v 4.3.3.1 90/07/21 20:12:10 davison Trn $ +/* $Header: artio.h,v 4.3.3.2 91/01/16 02:20:49 davison Trn $ = * = * $Log: artio.h,v $ + * Revision 4.3.3.2 91/01/16 02:20:49 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/07/21 20:12:10 davison = * Initial Trn Release @@ -27,7 +30,7 @@ =#ifdef SERVER =EXT ART_PART openpart INIT(0); /* how much of that article do we have? */ -FILE *nntpopen(); /* get an article unless already retrieved */ - -void nntpclose(); +FILE *nntpopen ANSI((ART_NUM,ART_PART)); + /* get an article unless already retrieved */ +void nntpclose ANSI((void)); =/* MUST be in increasing order of completeness! */ =#define GET_STATUS 1 /* test for existence only */ @@ -36,4 +39,4 @@ =#endif = -void artio_init(); -FILE *artopen(); /* open an article unless already opened */ +void artio_init ANSI((void)); +FILE *artopen ANSI((ART_NUM)); /* open an article unless already opened */ Index: artsrch.h @@ -1,5 +1,8 @@ -/* $Header: artsrch.h,v 4.3 85/05/01 11:35:55 lwall Exp $ +/* $Header: artsrch.h,v 4.3.3.1 91/01/16 02:21:37 davison Trn $ = * = * $Log: artsrch.h,v $ + * Revision 4.3.3.1 91/01/16 02:21:37 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:35:55 lwall = * Baseline for release with 4.3bsd. @@ -34,7 +37,8 @@ =#endif = -void artsrch_init(); +void artsrch_init ANSI((void)); =#ifdef ARTSEARCH - int art_search(); - bool wanted(); /* return TRUE if current article matches pattern */ + int art_search ANSI((char *, int, int)); + bool wanted ANSI((COMPEX *, ART_NUM, char)); + /* return TRUE if current article matches pattern */ =#endif Index: backpage.c @@ -1,7 +1,13 @@ -/* $Header: backpage.c,v 4.3.3.1 90/06/20 22:36:17 davison Trn $ +/* $Header: backpage.c,v 4.3.3.2 91/01/16 02:29:46 davison Trn $ = * = * $Log: backpage.c,v $ + * Revision 4.3.3.2 91/01/16 02:29:46 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:36:17 davison = * Initial Trn Release + * + * Revision 4.3.2.1 90/11/22 16:08:00 sob + * Made changes to accomodate picky C precompilers = * = * Revision 4.3 85/05/01 11:36:03 lwall Index: backpage.h @@ -1,5 +1,8 @@ -/* $Header: backpage.h,v 4.3 85/05/01 11:36:11 lwall Exp $ +/* $Header: backpage.h,v 4.3.3.1 91/01/16 02:29:47 davison Trn $ = * = * $Log: backpage.h,v $ + * Revision 4.3.3.1 91/01/16 02:29:47 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:36:11 lwall = * Baseline for release with 4.3bsd. @@ -15,5 +18,5 @@ =EXT long oldoffset INIT(-1); /* offset to block currently in window */ = -void backpage_init(); -ART_POS vrdary(); -void vwtary(); +void backpage_init ANSI((void)); +ART_POS vrdary ANSI((ART_LINE)); +void vwtary ANSI((ART_LINE,ART_POS)); Index: bits.c @@ -1,8 +1,17 @@ -/* $Header: bits.c,v 4.3.3.1 90/06/20 22:36:24 davison Trn $ +/* $Header: bits.c,v 4.3.3.2 91/01/16 02:29:48 davison Trn $ = * = * $Log: bits.c,v $ + * Revision 4.3.3.2 91/01/16 02:29:48 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:36:24 davison = * Initial Trn Release = * + * Revision 4.3.2.5 90/11/22 13:47:16 sob + * Altered #endifs to make System V compiliers happy. + * + * Revision 4.3.2.4 90/10/06 11:55:33 sob + * Added fix for DBM support. + * = * Revision 4.3.2.3 89/11/28 01:52:02 sob = * Removed some lint. @@ -399,4 +408,5 @@ = register ART_NUM x; = char tmpbuf[128]; + long pos; = =#ifdef DBM @@ -430,6 +440,7 @@ = if (rhs.dptr == NULL) /* if null, nothing there */ = goto wild_goose; - fseek (hist_file, *((long *)rhs.dptr), 0); - /* datum returned is position in hist file */ + bcopy((void *)rhs.dptr,(void *)&pos, 4); + fseek (hist_file, pos, 0); + /* datum returned is position in hist file */ = fgets (xref_buf, BUFSIZ, hist_file); =#ifdef DEBUGGING Index: bits.h @@ -1,8 +1,14 @@ -/* $Header: bits.h,v 4.3.3.1 90/06/20 22:36:35 davison Trn $ +/* $Header: bits.h,v 4.3.3.2 91/01/16 02:29:50 davison Trn $ = * = * $Log: bits.h,v $ + * Revision 4.3.3.2 91/01/16 02:29:50 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:36:35 davison = * Initial Trn Release = * + * Revision 4.3.2.1 90/11/22 15:46:42 sob + * Made changes to make pickly preprocessors happier. + * = * Revision 4.3.1.2 86/11/03 09:49:58 lwall = * Added firstbit variable. @@ -55,21 +61,21 @@ =#endif = -void bits_init(); -void checkpoint_rc(); -void restore_ng(); -void onemore(); -void oneless(); -void unmark_as_read(); +void bits_init ANSI((void)); +void checkpoint_rc ANSI((void)); +void restore_ng ANSI((void)); +void onemore ANSI((ART_NUM)); +void oneless ANSI((ART_NUM)); +void unmark_as_read ANSI((void)); =#ifdef USETHREADS -void set_read(); -void set_unread(); +void set_read ANSI((ART_NUM,int)); +void set_unread ANSI((ART_NUM,int)); =#endif -void delay_unmark(); -void mark_as_read(); -void check_first(); +void delay_unmark ANSI((ART_NUM)); +void mark_as_read ANSI((void)); +void check_first ANSI((ART_NUM)); =#ifdef DELAYMARK - void yankback(); + void yankback ANSI((void)); =#endif -int chase_xrefs(); -int initctl(); -void grow_ctl(); +int chase_xrefs ANSI((ART_NUM,int)); +int initctl ANSI((void)); +void grow_ctl ANSI((ART_NUM)); Index: cheat.h @@ -1,5 +1,8 @@ -/* $Header: cheat.h,v 4.3 85/05/01 11:36:58 lwall Exp $ +/* $Header: cheat.h,v 4.3.3.1 91/01/16 02:32:16 davison Trn $ = * = * $Log: cheat.h,v $ + * Revision 4.3.3.1 91/01/16 02:32:16 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:36:58 lwall = * Baseline for release with 4.3bsd. @@ -18,5 +21,5 @@ =#endif = -void cheat_init(); -void look_ahead(); -void collect_subjects(); +void cheat_init ANSI((void)); +void look_ahead ANSI((void)); +void collect_subjects ANSI((void)); Index: common.h @@ -1,5 +1,8 @@ -/* $Header: common.h,v 4.3.3.2 90/08/20 16:28:32 davison Trn $ +/* $Header: common.h,v 4.3.3.3 91/01/16 02:00:32 davison Trn $ = * = * $Log: common.h,v $ + * Revision 4.3.3.3 91/01/16 16:28:32 davison + * integrated rn patches 48-54 and tweaked defines a bit. + * = * Revision 4.3.3.2 90/08/20 16:28:32 davison = * Tweaked a couple rn's into trn's. @@ -8,4 +11,36 @@ = * Initial Trn Release = * + * Revision 4.3.2.23 90/12/30 23:58:59 sob + * Fixed CANCELHEADER. + * + * Revision 4.3.2.22 90/12/04 02:51:59 sob + * removed _SYS_TYPE.H label + * + * Revision 4.3.2.21 90/11/23 10:39:49 sob + * cleaned up more cruft. + * + * Revision 4.3.2.20 90/11/22 13:18:28 sob + * Conditionalized TRUE and FALSE to compensate for AIX which has its own + * definitions. + * + * Revision 4.3.2.19 90/11/09 23:15:12 sob + * Added sys/stream.h since sys/ptem.h depends on it. + * + * Revision 4.3.2.18 90/11/06 00:11:04 sob + * Attempt to deal with USG C compilers that can't cope with mutiple + * includes of the same include file. + * + * Revision 4.3.2.17 90/11/05 23:29:37 sob + * Added the include of /usr/include/sys/ptem.h if defined in config.h. + * + * Revision 4.3.2.16 90/11/04 03:34:32 sob + * Changed and moved GETWD to Configure. + * + * Revision 4.3.2.15 90/10/01 02:07:36 sob + * Increased LBUFLEN from 512 to 1024 per request of ken@csis.dit.csiro.au. + * + * Revision 4.3.2.14 90/10/01 01:56:06 sob + * Fixed problem with the call to MBOXSAVER reported by news@twwells.com. + * = * Revision 4.3.2.13 90/05/08 22:05:37 sob = * Added quick startup (-q) flag. @@ -66,9 +101,4 @@ = */ = -#include "config.h" /* generated by installation script */ -#ifdef WHOAMI -# include <whoami.h> -#endif - =#include <stdio.h> =#include <sys/types.h> @@ -75,5 +105,8 @@ =#include <sys/stat.h> =#include <ctype.h> - +#include "config.h" /* generated by installation script */ +#ifdef WHOAMI +# include <whoami.h> +#endif =#ifndef isalnum =# define isalnum(c) (isalpha(c) || isdigit(c)) @@ -100,6 +133,15 @@ =#endif = +#ifdef PTEM +#include <sys/stream.h> +#include <sys/ptem.h> +#endif + =#define BITSPERBYTE 8 +#ifdef pdp11 =#define LBUFLEN 512 /* line buffer length */ +#else +#define LBUFLEN 1024 /* line buffer length */ +#endif = /* (don't worry, .newsrc lines can exceed this) */ =#ifdef pdp11 @@ -121,6 +163,10 @@ = =#define bool char +#ifndef TRUE =#define TRUE (1) +#endif +#ifndef FALSE =#define FALSE (0) +#endif =#define Null(t) ((t)0) =#define Nullch Null(char *) @@ -294,5 +340,4 @@ =#define TILDENAME /* allow ~logname expansion */ =#define SETENV /* allow command line environment variable setting */ -#define GETWD /* use our getwd() instead of piped in pwd */ =#define MAKEDIR /* use our makedir() instead of shell script */ =#define MEMHELP /* keep help messages in memory */ @@ -453,14 +498,23 @@ =#endif = -#ifdef THREAD_DIR +#ifdef USETHREADS +# ifdef THREAD_DIR =# ifdef LONG_THREAD_NAMES =# undef SUFFIX =# else +# ifndef SUFFIX =# define SUFFIX ".th" +# endif =# endif -#else +# else =# define THREAD_DIR SPOOL -# define SUFFIX "/.thread" +# ifndef SUFFIX +# define SUFFIX "/.thread" +# endif =# undef LONG_THREAD_NAMES +# endif +# ifndef NEW_THREAD +# define NEW_THREAD ".new" +# endif =#endif = @@ -538,4 +592,9 @@ =#endif = +/* where to compile a new newsgroup list */ +#ifndef RNEWNAME +# define RNEWNAME "/tmp/rnew.%$" +#endif + =/* file to pass header to followup article poster */ =#ifndef HEADNAME /* % and ~ */ @@ -740,7 +799,7 @@ =#ifndef CANCELHEADER =#ifdef INTERNET -# define CANCELHEADER "Newsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nDistribution: %D\nOrganization: %o\n\nThis message was cancelled from within trn.\n" +# define CANCELHEADER "From: %L@%H (%N)\nNewsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nDistribution: %D\nOrganization: %o\n\nThis message was cancelled from within trn.\n" =#else -# define CANCELHEADER "Newsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nDistribution: %D\nOrganization: %o\n" +# define CANCELHEADER "From:%L@%H.UUCP (%N)\nNewsgroups: %n\nSubject: cmsg cancel %i\nReferences: %R\nDistribution: %D\nOrganization: %o\n" =#endif =#endif @@ -751,4 +810,22 @@ =#endif = +/* how to open binary format files */ +#ifndef FOPEN_RB +# define FOPEN_RB "r" +#endif +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif + +/* what to do with ansi prototypes -- '()' == ignore, 'x' == use */ +#ifndef ANSI +# define ANSI(x) () +#endif + +/* how many characters is a newline in a text file? */ +#ifndef NL_SIZE +# define NL_SIZE 1 +#endif + =/* some important types */ = @@ -837,5 +914,5 @@ =#endif =#ifdef CLEAREOL -EXT bool can_home_clear INIT(FALSE); /* fancy -e -- PWP */ +EXT bool can_home_clear INIT(FALSE); /* fancy -e */ =#endif =EXT bool findlast INIT(FALSE); /* -r */ Index: final.c @@ -1,8 +1,14 @@ -/* $Header: final.c,v 4.3.3.1 90/06/20 22:36:57 davison Trn $ +/* $Header: final.c,v 4.3.3.2 91/01/16 02:38:15 davison Trn $ = * = * $Log: final.c,v $ + * Revision 4.3.3.2 91/01/16 02:38:15 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:36:57 davison = * Initial Trn Release = * + * Revision 4.3.2.9 90/11/22 16:08:34 sob + * Added changes to accomodate pick C preprocessors. + * = * Revision 4.3.2.8 90/04/14 19:37:14 sob = * Added better support for the NeXT. @@ -60,15 +66,25 @@ = = sigset(SIGINT, int_catcher); /* always catch interrupts */ +#ifdef SIGHUP = sigset(SIGHUP, sig_catcher); /* and hangups */ +#endif =#ifndef lint +#ifdef SIGEMT = sigignore(SIGEMT); +#endif =#endif /* lint */ = = sigset(SIGILL, sig_catcher); +#ifdef SIGTRAP = sigset(SIGTRAP, sig_catcher); +#endif = sigset(SIGFPE, sig_catcher); +#ifdef SIGBUS = sigset(SIGBUS, sig_catcher); +#endif = sigset(SIGSEGV, sig_catcher); +#ifdef SIGSYS = sigset(SIGSYS, sig_catcher); +#endif = sigset(SIGTERM, sig_catcher); =#ifdef SIGXCPU @@ -115,5 +131,5 @@ =/* come here on interrupt */ = -int +SIGRET =int_catcher() ={ @@ -134,5 +150,5 @@ =/* come here on signal other than interrupt, stop, or cont */ = -int +SIGRET =sig_catcher(signo) ={ @@ -192,5 +208,7 @@ = write_rc(); /* then do so */ = rc_changed = FALSE; +#ifdef SIGHUP = if (signo != SIGHUP) +#endif =#ifdef VERBOSE = IF(verbose) @@ -203,5 +221,7 @@ =#endif = switch (signo) { +#ifdef SIGBUS = case SIGBUS: +#endif = case SIGILL: = case SIGSEGV: @@ -214,5 +234,5 @@ =/* come here on stop signal */ = -int +SIGRET =stop_catcher(signo) =int signo; Index: final.h @@ -1,5 +1,8 @@ -/* $Header: final.h,v 4.3.3.1 90/06/20 22:37:04 davison Trn $ +/* $Header: final.h,v 4.3.3.2 91/01/16 02:38:16 davison Trn $ = * = * $Log: final.h,v $ + * Revision 4.3.3.2 91/01/16 02:38:16 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:37:04 davison = * Initial Trn Release @@ -25,11 +28,10 @@ =/* signal catching routines */ = -int int_catcher(); -int sig_catcher(); +SIGRET int_catcher ANSI((void)); +SIGRET sig_catcher ANSI((int)); =#ifdef SIGTSTP - int stop_catcher(); - int cont_catcher(); + SIGRET stop_catcher ANSI((int)); =#endif = -void final_init(); -void finalize(); +void final_init ANSI((void)); +void finalize ANSI((int)); Index: head.c @@ -1,8 +1,17 @@ -/* $Header: head.c,v 4.3.3.1 90/07/21 20:19:26 davison Trn $ +/* $Header: head.c,v 4.3.3.2 91/01/16 02:41:15 davison Trn $ = * = * $Log: head.c,v $ + * Revision 4.3.3.2 91/01/16 02:41:15 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/07/21 20:19:26 davison = * Initial Trn Release = * + * Revision 4.3.2.7 90/11/22 13:49:50 sob + * Added changes to make System V compilers happy. + * + * Revision 4.3.2.6 90/10/01 01:59:10 sob + * Fixed possible core dump problem reported by geoff@desint.uucp + * = * Revision 4.3.2.5 90/03/22 23:04:22 sob = * Fixes provided by Wayne Davison <drivax!davison> @@ -376,12 +385,12 @@ = if (*tmp_buf == ' ' || *tmp_buf == '\t') = t = tmp_buf; - else - t = index(tmp_buf,':')+1; - if (t == Nullch) - break; = else { - while (*t == ' ' || *t == '\t') t++; - safecat(newbuf,t,size); + t = index(tmp_buf,':'); + if (t == Nullch) + break; + t++; = } + while (*t == ' ' || *t == '\t') t++; + safecat(newbuf,t,size); = } = return newbuf; Index: head.h @@ -1,5 +1,8 @@ -/* $Header: head.h,v 4.3.3.1 90/06/20 22:37:18 davison Trn $ +/* $Header: head.h,v 4.3.3.2 91/01/16 02:41:17 davison Trn $ = * = * $Log: head.h,v $ + * Revision 4.3.3.2 91/01/16 02:41:17 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:37:18 davison = * Initial Trn Release @@ -114,11 +117,15 @@ =#endif = -void head_init(); -int set_line_type(); -void start_header(); -bool parseline(); +void head_init ANSI((void)); +int set_line_type ANSI((char *,char *)); +void start_header ANSI((ART_NUM)); +bool parseline ANSI((char *,int,int)); =#ifdef ASYNC_PARSE - int parse_maybe(); + int parse_maybe ANSI((ART_NUM)); +#endif +char *fetchsubj ANSI((ART_NUM,bool,bool)); +char *fetchlines ANSI((ART_NUM,int)); + +#ifdef DEBUGGING +int dumpheader ANSI((char *)); =#endif -char *fetchsubj(); -char *fetchlines(); Index: help.h @@ -1,5 +1,8 @@ -/* $Header: help.h,v 4.3.3.1 90/06/20 22:37:34 davison Trn $ +/* $Header: help.h,v 4.3.3.2 91/01/16 02:41:20 davison Trn $ = * = * $Log: help.h,v $ + * Revision 4.3.3.2 91/01/16 02:41:20 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:37:34 davison = * Initial Trn Release @@ -10,12 +13,12 @@ = */ = -void help_init(); -int help_ng(); -int help_art(); -int help_page(); +void help_init ANSI((void)); +int help_ng ANSI((void)); +int help_art ANSI((void)); +int help_page ANSI((void)); =#ifdef ESCSUBS - int help_subs(); + int help_subs ANSI((void)); =#endif =#ifdef USETHREADS - int help_select(); + int help_select ANSI((void)); =#endif Index: init.c @@ -1,8 +1,18 @@ -/* $Header: init.c,v 4.3.3.1 90/06/20 22:37:39 davison Trn $ +/* $Header: init.c,v 4.3.3.2 91/01/16 02:43:39 davison Trn $ = * = * $Log: init.c,v $ + * Revision 4.3.3.2 91/01/16 02:43:39 davison + * Integrated rn patches 48-54. Twiddled 'rn' to 'trn'. + * = * Revision 4.3.3.1 90/06/20 22:37:39 davison = * Initial Trn Release = * + * Revision 4.3.2.8 90/11/22 13:51:39 sob + * Removed some cruft trailing the #endif directive to make more compilers + * happy. + * + * Revision 4.3.2.7 90/10/30 22:42:23 sob + * Used fileno() instead of _file to increase portability. + * = * Revision 4.3.2.6 90/05/08 22:05:55 sob = * Added quick startup (-q) flag. @@ -218,5 +228,6 @@ = =#ifdef FINDNEWNG - fstat(actfp->_file,&filestat); /* did active file grow? */ +/* fstat(actfp->_file,&filestat); ... does not work on Apollos */ + fstat(fileno(actfp),&filestat); /* did active file grow? */ = /* = * Skip this check if the -q flag was given. @@ -244,5 +255,5 @@ =#ifdef FASTNEW = if (!munged) { /* maybe just do tail of file? */ - fseek(actfp,lastactsiz-1,0); + fseek(actfp,lastactsiz-NL_SIZE,0); = fgets(buf,LBUFLEN,actfp); = munged = (*buf != '\n'); @@ -292,5 +303,5 @@ =#ifdef VERBOSE = IF(verbose) - printf("You seem to have left an rn running, process %d.\n", + printf("You seem to have left a trn running, process %d.\n", = processnum) FLUSH; = ELSE @@ -297,5 +308,5 @@ =#endif =#ifdef TERSE - printf("Rn left running, #%d.\n", processnum) FLUSH; + printf("Trn left running, #%d.\n", processnum) FLUSH; =#endif = if (kill(processnum, SIGEMT)) { @@ -332,5 +343,5 @@ = IF(verbose) = fputs("\n\ -You may not have two copies of rn running simultaneously. Goodbye.\n\ +You may not have two copies of [t]rn running simultaneously. Goodbye.\n\ =",stdout) FLUSH; = ELSE @@ -360,5 +371,6 @@ = = if ((tmpfp = fopen(newsnewsname,"r")) != Nullfp) { - fstat(tmpfp->_file,&filestat); +/* fstat(tmpfp->_file,&filestat); .... does not work on Apollos */ + fstat(fileno(tmpfp),&filestat); = if (filestat.st_mtime > lasttime) { = while (fgets(buf,sizeof(buf),tmpfp) != Nullch) Index: init.h @@ -1,5 +1,8 @@ -/* $Header: init.h,v 4.3 85/05/01 11:40:46 lwall Exp $ +/* $Header: init.h,v 4.3.3.1 91/01/16 02:43:40 davison Trn $ = * = * $Log: init.h,v $ + * Revision 4.3.3.1 91/01/16 02:43:40 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:40:46 lwall = * Baseline for release with 4.3bsd. @@ -9,6 +12,5 @@ =EXT char *lockname INIT(nullstr); = -bool initialize(); -void lock_check(); -void newsnews_check(); -void version_check(); +bool initialize ANSI((int,char **)); +void lock_check ANSI((void)); +void newsnews_check ANSI((void)); Index: intrp.c @@ -1,5 +1,8 @@ -/* $Header: intrp.c,v 4.3.3.2 90/08/20 16:29:08 davison Trn $ +/* $Header: intrp.c,v 4.3.3.3 91/01/16 02:43:42 davison Trn $ = * = * $Log: intrp.c,v $ + * Revision 4.3.3.3 91/01/16 02:43:42 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.2 90/08/20 16:29:08 davison = * Added HOSTFILE handling. Add OURDOMAIN if site has no '.' @@ -8,4 +11,27 @@ = * Initial Trn Release = * + * Revision 4.3.2.11 90/12/31 11:47:44 sob + * NEWSADMIN could not cancel articles because it was not getting set. + * + * Revision 4.3.2.10 90/12/31 00:02:55 sob + * Moved HIDDENET to remove unneeded cruft. + * + * Revision 4.3.2.9 90/12/30 03:48:11 sob + * Changed "hidden" to "hiddennet" to be like nntp and bnews. + * Made it possible to cancel articles if hiddennet is defined. + * + * Revision 4.3.2.8 90/11/22 13:52:27 sob + * Made changes to keep preprocessors from complaining. + * + * Revision 4.3.2.7 90/11/05 23:59:33 sob + * moved the definition of tmpbuf such that it get defined before it is used. + * + * Revision 4.3.2.6 90/11/03 18:52:31 sob + * Fixed bug in the definition of the nodename using the uname() system call. + * + * Revision 4.3.2.5 90/10/01 01:31:18 sob + * Fixed problem with struct utsname reported by jrallen@devildog.att.com + * when rn is compiled on the Amdahl 5890 UTS 2.0 system. + * = * Revision 4.3.2.4 90/04/23 00:31:20 sob = * Removed unneeded atoi call. @@ -64,4 +90,5 @@ = =/* name of this site */ +#ifndef HIDDENNET =#ifdef GETHOSTNAME = char *hostname; @@ -71,7 +98,7 @@ =# ifdef DOUNAME =# include <sys/utsname.h> - struct utsname uts; + struct utsname utsn; =# undef SITENAME -# define SITENAME uts.nodename +# define SITENAME utsn.nodename =# else /* !DOUNAME */ =# ifdef PHOSTNAME @@ -87,4 +114,5 @@ =# endif /* DOUNAME */ =#endif /* GETHOSTNAME */ +#endif /*HIDDENNET */ = =#ifdef TILDENAME @@ -95,11 +123,9 @@ =char *realname INIT(Nullch); /* real name of sender from /etc/passwd */ = -char *dointerp(); -char *getrealname(); =#ifdef CONDSUB -char *skipinterp(); +char *skipinterp ANSI((char *,char *)); =#endif = -static void abort_interp(); +static void abort_interp ANSI((void)); = =void @@ -113,4 +139,15 @@ = /* get environmental stuff */ = +#ifdef NEWSADMIN +#ifdef GETPWENT + { + struct passwd *getpwnam(); + struct passwd *pwd = getpwnam(NEWSADMIN); + + if (pwd != NULL) + newsuid = pwd->pw_uid; + } +#endif /* GETPWENT */ +#endif /* NEWSADMIN */ = /* get home directory */ = @@ -155,4 +192,5 @@ = /* name of this site (%H) */ = +#ifndef HIDDENNET =#ifdef HOSTFILE = if ((tmpfp = fopen(HOSTFILE,"r")) == NULL) { @@ -172,5 +210,5 @@ =#ifdef DOUNAME = /* get sysname */ - uname(&uts); + uname(&utsn); =#else =#ifdef PHOSTNAME @@ -188,9 +226,8 @@ = pclose(pipefp); = } -#endif -#endif -#endif -#endif -#ifdef OURDOMAIN +#endif /* PHOSTNAME */ +#endif /* DOUNAME */ +#endif /* GETHOSTNAME */ +#endif /* HOSTFILE */ = if (index(SITENAME,'.') == NULL) { = sprintf(buf, "%s.%s", SITENAME, OURDOMAIN); @@ -197,6 +234,8 @@ = sitename = savestr(buf); = } else -#endif = sitename = savestr(SITENAME); +#else + sitename = savestr(OURDOMAIN); +#endif =} = @@ -1092,4 +1131,5 @@ ={ = char *s, *c; + char tmpbuf[512]; = =#ifdef PASSNAMES @@ -1099,5 +1139,4 @@ = s = pwd->pw_gecos; =#else - char tmpbuf[512]; = int i; = @@ -1156,2 +1195,4 @@ = sig_catcher(0); =} + + Index: intrp.h @@ -1,5 +1,8 @@ -/* $Header: intrp.h,v 4.3.3.1 90/06/20 22:38:00 davison Trn $ +/* $Header: intrp.h,v 4.3.3.2 91/01/16 02:43:45 davison Trn $ = * = * $Log: intrp.h,v $ + * Revision 4.3.3.2 91/01/16 02:43:45 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:38:00 davison = * Initial Trn Release @@ -24,8 +27,8 @@ =#endif = -void intrp_init(); -char *filexp(); -char *dointerp(); -void interp(); -void refscpy(); -char *getrealname(); +void intrp_init ANSI((char *)); +char *filexp ANSI((char *)); +char *dointerp ANSI((char *,int,char *,char *)); +void interp ANSI((char *,int,char *)); +void refscpy ANSI((char *,int,char *)); +char *getrealname ANSI((int)); Index: kfile.c @@ -1,9 +1,15 @@ -/* $Header: kfile.c,v 4.3.3.1 90/06/20 22:38:06 davison Trn $ +/* $Header: kfile.c,v 4.3.3.2 91/01/16 02:46:28 davison Trn $ = * = * $Log: kfile.c,v $ + * Revision 4.3.3.2 91/01/16 02:46:28 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:38:06 davison = * Initial Trn Release = * - * Revision 1.2 90/03/22 23:04:41 sob + * Revision 4.3.2.2 90/11/22 16:09:54 sob + * Added changes to accomodate picky C preprocessors + * + * Revision 4.3.2.1 90/03/22 23:04:41 sob = * Fixes provided by Wayne Davison <drivax!davison> = * Index: kfile.h @@ -1,5 +1,8 @@ -/* $Header: kfile.h,v 4.3 85/05/01 11:42:00 lwall Exp $ +/* $Header: kfile.h,v 4.3.3.1 91/01/16 02:46:29 davison Trn $ = * = * $Log: kfile.h,v $ + * Revision 4.3.3.1 91/01/16 02:46:29 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:42:00 lwall = * Baseline for release with 4.3bsd. @@ -16,10 +19,9 @@ =#endif = -void kfile_init(); -int do_kfile(); -void kill_unwanted(); -int edit_kfile(); -void open_kfile(); -void kf_append(); -void setthru(); - +void kfile_init ANSI((void)); +int do_kfile ANSI((FILE *,int)); +void kill_unwanted ANSI((ART_NUM,char *,int)); +int edit_kfile ANSI((void)); +void open_kfile ANSI((int)); +void kf_append ANSI((char *)); +void setthru ANSI((ART_NUM)); Index: last.c @@ -1,5 +1,8 @@ -/* $Header: last.c,v 4.3.2.1 89/12/20 23:23:07 sob Exp $ +/* $Header: last.c,v 4.3.3.1 91/01/16 02:47:15 davison Trn $ = * = * $Log: last.c,v $ + * Revision 4.3.3.1 91/01/16 02:47:15 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.2.1 89/12/20 23:23:07 sob = * .rnlast sometimes is a null file. This gives bogus information when Index: last.h @@ -1,5 +1,8 @@ -/* $Header: last.h,v 4.3 85/05/01 11:42:22 lwall Exp $ +/* $Header: last.h,v 4.3.3.1 91/01/16 02:47:16 davison Trn $ = * = * $Log: last.h,v $ + * Revision 4.3.3.1 91/01/16 02:47:16 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:42:22 lwall = * Baseline for release with 4.3bsd. @@ -11,4 +14,4 @@ =EXT long lastactsiz INIT(0); /* size of active file when rn last started up */ = -void last_init(); -void writelast(); +void last_init ANSI((char *)); +void writelast ANSI((void)); Index: makedepend.SH @@ -5,10 +5,16 @@ =$spitshell >makedepend <<!GROK!THIS! =$startsh -# $Header: makedepend.SH,v 4.3.3.1 90/06/20 22:38:14 davison Trn $ +# $Header: makedepend.SH,v 4.3.3.2 91/01/16 02:48:09 davison Trn $ =# =# $Log: makedepend.SH,v $ +# Revision 4.3.3.2 91/01/16 02:48:09 davison +# Integrated rn patches 48-54. +# =# Revision 4.3.3.1 90/06/20 22:38:14 davison =# Initial Trn Release =# +# Revision 4.3.2.3 90/10/30 22:46:14 sob +# Made minor changes to the send command to work better on Apollos. +# =# Revision 4.3.2.2 90/04/21 14:24:58 sob =# Added a fix to deal with XENIX cc -E output. @@ -59,5 +65,5 @@ = echo "Updating Makefile..." = echo "# If this runs make out of memory, delete /usr/include lines." >>Makefile.new - $cat .deptmp >>Makefile.new + $sed -e 's/\\\$/\$\$/g' .deptmp >>Makefile.new =else = $echo "You don't seem to have a proper C preprocessor. Using grep instead." Index: makedir.SH @@ -5,7 +5,13 @@ =$spitshell >makedir <<!GROK!THIS! =$startsh -# $Header: makedir.SH,v 4.3 85/05/01 11:42:31 lwall Exp $ +# $Header: makedir.SH,v 4.3.3.1 91/01/16 02:48:09 davison Trn $ =# =# $Log: makedir.SH,v $ +# Revision 4.3.3.1 91/01/16 02:48:09 davison +# Integrated rn patches 48-54. +# +# Revision 4.3.2.1 90/11/22 14:02:49 sob +# changes . config.sh to . ./config.sh +# =# Revision 4.3 85/05/01 11:42:31 lwall =# Baseline for release with 4.3bsd. Index: Makefile.SH @@ -4,10 +4,16 @@ =echo "Extracting Makefile (with variable substitutions)" =cat >Makefile <<!GROK!THIS! -# $Header: Makefile.SH,v 4.3.3.1 90/07/28 18:14:56 davison Trn $ +# $Header: makefile.SH,v 4.3.3.2 91/01/16 02:48:10 davison Trn $ =# -# $Log: Makefile.SH,v $ +# $Log: makefile.SH,v $ +# Revision 4.3.3.2 91/01/16 02:48:10 davison +# Integrated rn patches 48-54. +# =# Revision 4.3.3.1 90/07/28 18:14:56 davison =# Initial Trn Release =# +# Revision 4.3.2.11 90/11/22 13:57:53 sob +# Added support for additional CFLAGS and better cleanup. +# =# Revision 4.3.2.10 90/05/04 00:44:51 sob =# Added socketlib to list of libs. @@ -60,5 +66,5 @@ =#NNTPNNTPDIR = $NNTPSRC =#NNTPNNTPINC = $rrninclude -CFLAGS = $iandd -O $include +CFLAGS = $iandd $addcflags -O $include =LDFLAGS = $iandd =NDIRC = $ndirc @@ -111,7 +117,8 @@ =add3 = loc makedepend makedir mbox.saver newsetup =add4 = newsgroups newsnews norm.saver -add5 = pdp11 usg v7 ultrix sun hp-ux pyr sgi xenix server.h +add5 = pdp11 usg v7 ultrix sun hp-ux sgi xenix server.h +add6 = all pyr grimble .falseactive Pnews.header s5uniq = -addedbyconf = $(add1) $(add2) $(add3) $(add4) $(add5) +addedbyconf = $(add1) $(add2) $(add3) $(add4) $(add5) $(add6) = =# grrr Index: mbox.saver.SH @@ -11,4 +11,7 @@ =# Added support for MMDF format mailboxes. =# +# Revision 4.3.2.3 90/11/22 14:28:27 sob +# Changed . config.sh to . ./config.sh +# =# Revision 4.3.2.2 90/03/17 20:44:54 sob =# Modify Article header to place the colon after Article. Index: mt.check.SH @@ -5,7 +5,10 @@ =$spitshell >mt.check <<!GROK!THIS! =$startsh -# $Header: mt.check.SH,v 4.3.3.2 90/08/20 16:42:10 davison Trn $ +# $Header: mt.check.SH,v 4.3.3.3 91/01/16 02:50:10 davison Trn $ =# =# $Log: mt.check.SH,v $ +# Revision 4.3.3.3 91/01/16 02:50:10 davison +# Added missing grok line at eof. +# =# Revision 4.3.3.2 90/08/20 16:42:10 davison =# Changed email address. @@ -59,2 +62,3 @@ = =exit 0 +!GROK!THIS! Index: mt-lint.h @@ -1,5 +1,8 @@ -/* $Header: mt-lint.h,v 4.3.3.1 90/06/20 22:55:11 davison Trn $ +/* $Header: mt-lint.h,v 4.3.3.2 91/01/16 02:49:11 davison Trn $ =** =** $Log: mt-lint.h,v $ +** Revision 4.3.3.2 91/01/16 02:49:11 davison +** Changed Free() to safefree(). +** =** Revision 4.3.3.1 90/06/20 22:55:11 davison =** Initial Trn Release @@ -49,4 +52,4 @@ =#define safemalloc(x) (NULL) =#define free(x) (x = NULL) -#define Free(x) (*x = NULL) +#define safefree(x) (*x = NULL) =#define signal(x,y) Index: mt-process.c @@ -1,5 +1,8 @@ -/* $Header: mt-process.c,v 4.3.3.2 90/08/20 16:40:31 davison Trn $ +/* $Header: mt-process.c,v 4.3.3.3 91/01/18 19:13:20 davison Trn $ =** =** $Log: mt-process.c,v $ +** Revision 4.3.3.3 91/01/18 19:13:20 davison +** Removed the code that tried to exclude certain message ids. Added -s option +** =** Revision 4.3.3.2 90/08/20 16:40:31 davison =** Added check of caught_interrupt flag into main loops. @@ -31,7 +34,5 @@ =char author_str[20]; = -extern int log_verbosity; - -extern time_t getdate(); +extern int log_verbosity, slow_down; = =DOMAIN *next_domain; @@ -87,4 +88,7 @@ = } =#ifdef SERVER + if( slow_down ) { + sleep( slow_down ); + } = sprintf( buff, "HEAD %ld", (long)i ); = put_server( buff ); @@ -882,5 +886,4 @@ =register char *start, *end; ={ - int lower_case; = char *mid; = @@ -904,18 +907,5 @@ = return 0; /* RETURN */ = } - /* Try to weed-out non-ids (user@domain) by looking for lower-case without - ** digits in the unique portion. B news ids are all digits; standard C - ** news are digits with mixed case; and Zeeff message ids are any mixture - ** of digits, certain punctuation characters and upper-case. - */ - lower_case = 0; - do { - if( *start <= '9' && *start >= '0' ) { - return 1; /* RETURN */ - } - lower_case = lower_case || (*start >= 'a' && *start <= 'z'); - } while( ++start < mid ); - - return !lower_case; + return 1; =} = Index: mt-read.c @@ -1,5 +1,8 @@ -/* $Header: mt-read.c,v 4.3.3.1 90/07/24 23:51:12 davison Trn $ +/* $Header: mt-read.c,v 4.3.3.2 91/01/16 02:49:15 davison Trn $ =** =** $Log: mt-read.c,v $ +** Revision 4.3.3.2 91/01/16 02:49:15 davison +** Changed Free() to safefree(). Tweaked fopen for possible binary open mode. +** =** Revision 4.3.3.1 90/07/24 23:51:12 davison =** Initial Trn Release @@ -28,5 +31,5 @@ = unk_domain.link = Null(DOMAIN*); = - if( (fp_in = fopen( filename, "r" )) == Nullfp ) { + if( (fp_in = fopen( filename, FOPEN_RB )) == Nullfp ) { = bzero( &total, sizeof (TOTAL) ); = return 0; @@ -56,15 +59,15 @@ = return 1; = } - /* Something failed. Free takes care of checking if we're partially + /* Something failed. Safefree takes care of checking if we're partially = ** allocated. Any linked-list structures we created were freed before = ** we got here. = */ - Free( &strings ); - Free( &subject_cnts ); - Free( &author_cnts ); - Free( &root_array ); - Free( &subject_array ); - Free( &article_array ); - Free( &ids ); + safefree( &strings ); + safefree( &subject_cnts ); + safefree( &author_cnts ); + safefree( &root_array ); + safefree( &subject_array ); + safefree( &article_array ); + safefree( &ids ); = fclose( fp_in ); = return 0; @@ -484,5 +487,5 @@ =/* Free some memory if it hasn't already been freed. */ =void -Free( pp ) +safefree( pp ) =char **pp; ={ Index: mt-write.c @@ -1,5 +1,8 @@ -/* $Header: mt-write.c,v 4.3.3.1 90/07/24 23:51:18 davison Trn $ +/* $Header: mt-write.c,v 4.3.3.2 91/01/16 02:49:17 davison Trn $ =** =** $Log: mt-write.c,v $ +** Revision 4.3.3.2 91/01/16 02:49:17 davison +** Tweaked fopen for possible binary open mode. +** =** Revision 4.3.3.1 90/07/24 23:51:18 davison =** Initial Trn Release @@ -37,5 +40,5 @@ = log_error( "Unable to create path: `%s'.\n", filename ); = failure = 2; - } else if( (fp_out = fopen( filename, "w" )) == Nullfp ) { + } else if( (fp_out = fopen( filename, FOPEN_WB )) == Nullfp ) { = log_error( "Unable to create file: `%s'.\n", filename ); = failure = 2; Index: mthreads.1 @@ -1,5 +1,8 @@ -''' $Header: mthreads.1,v 4.3.3.2 90/08/20 16:42:32 davison Trn $ +''' $Header: mthreads.1,v 4.3.3.3 91/01/18 19:27:39 davison Trn $ =''' =''' $Log: mthreads.1,v $ +''' Revision 4.3.3.3 91/01/18 19:27:39 davison +''' Added commands -s and -z. +''' =''' Revision 4.3.3.2 90/08/20 16:42:32 davison =''' Document new command-line interface. @@ -136,4 +139,5 @@ =specifies a debugging mode where only the groups mentioned on the =command-line are processed \*(-- all other groups are left unchanged. +It also outputs each group's name into the log file before it is processed. =.TP 5 =.B \-d @@ -187,4 +191,12 @@ =actually doing any of the processing right away. =.TP 5 +.B -s +tells mthreads to sleep one second before processing each article. +This is useful if your NNTP server cannot handle mthreads running at +full speed. +For each additional +.B -s +specified, mthreads sleeps an additional second. +.TP 5 =.B -v =selects additional levels of verbosity in the log file. @@ -195,4 +207,10 @@ =to get extra reference line problems logged into the file. =Add a second and a third for even more (useless?) information. +A fourth will cause mthreads to output each group's name into the log file +before it is processed. +.TP 5 +.B -z +tells mthreads to 'zap' any thread file it believes to be corrupt. +This will allow the file to be regenerated from scratch on the next pass. =.TP 5 =.B hierarchy_list Index: mthreads.h @@ -1,5 +1,8 @@ -/* $Header: mthreads.h,v 4.3.3.2 90/08/20 16:44:29 davison Trn $ +/* $Header: mthreads.h,v 4.3.3.3 91/01/16 03:16:33 davison Trn $ =** =** $Log: mthreads.h,v $ +** Revision 4.3.3.3 91/01/16 03:16:33 davison +** Added optional prototyping. +** =** Revision 4.3.3.2 90/08/20 16:44:29 davison =** New entries for new command-line interface. @@ -21,5 +24,5 @@ =EXT int expired_articles, expired_count; =EXT bool extra_expire INIT(FALSE); -EXT bool caught_interrupt INIT(FALSE); +EXT int caught_interrupt INIT(0); = =EXT char *strings INIT(0); @@ -47,20 +50,28 @@ =#endif = -int ngmatch(), onepatmatch(); - -void log_entry(), log_error(); +int ngmatch ANSI((char *,char *)); +int onepatmatch ANSI((char *,char *)); = -void mybytemap(); -int read_data(), write_data(); -void dont_read_data(), process_data(); +void log_entry(); +void log_error(); + +void mybytemap ANSI((BMAP *)); +int read_data ANSI((void)); +int write_data ANSI((char *)); +void dont_read_data(int); + +void process_articles ANSI((ART_NUM,ART_NUM)); = -void process_articles(); +char *thread_name ANSI((char *)); +char *file_exp ANSI((char *)); +char *savestr ANSI((char *)); = -char *thread_name(), *file_exp(), *savestr(); - =#ifndef lint -char *safemalloc(); -void free(), Free(); +char *safemalloc ANSI((MEM_SIZE)); +void free(); +void safefree(); =#endif + +time_t getdate ANSI((char *,time_t,long)); = =#define Nullart Null(ARTICLE*) Index: ndir.c @@ -1,7 +1,16 @@ -/* $Header: ndir.c,v 4.3.3.1 90/06/20 22:38:20 davison Trn $ +/* $Header: ndir.c,v 4.3.3.2 91/01/16 03:18:03 davison Trn $ = * = * $Log: ndir.c,v $ + * Revision 4.3.3.2 91/01/16 03:18:03 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:38:20 davison = * Initial Trn Release + * + * Revision 4.3.1.6 90/11/22 16:08:50 sob + * Added changes to accomodate pick C preprocessors. + * + * Revision 4.3.1.5 90/03/22 23:04:47 sob + * Fixes provided by Wayne Davison <drivax!davison> = * = * Revision 4.3.1.3 85/05/23 11:19:24 lwall SHAR_EOF fi exit 0 # End of shell archive ----8<------8<------8<------8<-----the end------>8------>8------>8------>8----
davison%borla@kithrup.com (01/20/91)
Here is patch #2 for trn (producing v1.0.2). Part 2 of 2 ** Please apply ** To extract this from trn, type "e dir" where dir is the directory you want the patch placed. Otherwise, delete everything through the first cut line and run it through sh. Be sure to unpack part 1 of this patch in a similar manner and then follow the directions in the file patch2a. -- \ /| / /|\/ /| /(_) Wayne Davison (_)/ |/ /\|/ / |/ \ 0004475895@mcimail.com (preferred) (W A Y N e) davison@dri.com (...!uunet!drivax!davison) ----8<------8<------8<------8<-----cut here----->8------>8------>8------>8---- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # patch2b # This archive created: Fri Jan 19 20:02:31 1991 export PATH; PATH=/bin:/usr/bin:$PATH echo shar: "extracting 'patch2b'" '(63583 characters)' if test -f 'patch2b' then echo shar: "will not over-write existing file 'patch2b'" else cat << \SHAR_EOF > 'patch2b' Trn patch #2 PART 2 OF 2. See the file patch2a for instructions on how to install this patch and for a brief list of what has changed. Index: rn.c Prereq: v1.0.1 @@ -10,8 +10,11 @@ =*/ = -static char rnid[] = "@(#)$Header: rn.c,v 4.3.3.2 90/08/20 16:48:19 davison Trn $"; -static char patchlevel[] = "Trn v1.0.1 based on Rn patchlevel 47"; +static char rnid[] = "@(#)$Header: rn.c,v 4.3.3.3 91/01/16 03:28:42 davison Trn $"; +static char patchlevel[] = "Trn v1.0.2 based on Rn patchlevel 54"; = =/* $Log: rn.c,v $ + * Revision 4.3.3.3 91/01/16 03:28:42 davison + * Integrated rn patches 48-54. Fixed in_char and verify interaction. + * = * Revision 4.3.3.2 90/08/20 16:48:19 davison = * Changed unthreaded group's default action, version #, email address. @@ -20,4 +23,25 @@ = * Initial Trn Release = * + * Revision 4.3.2.11 91/01/04 22:58:24 sob + * Checkpoint for patch 54 + * + * Revision 4.3.2.10 90/12/30 22:58:24 sob + * Checkpoint for patch 53 + * + * Revision 4.3.2.9 90/12/13 22:58:24 sob + * Checkpoint for patch 52 + * + * Revision 4.3.2.8 90/12/10 01:35:43 sob + * Checkpoint for patch 51 + * + * Revision 4.3.2.7 90/11/23 20:30:43 sob + * Checkpoint for patch 50 + * + * Revision 4.3.2.6 90/11/22 13:55:23 sob + * Checkpoint for patch #49 + * + * Revision 4.3.2.5 90/11/06 01:19:43 sob + * Checkpoint for patch 48 + * = * Revision 4.3.2.4 90/04/03 23:11:33 sob = * Added more information to the version command. @@ -215,6 +239,6 @@ = IF(verbose) = sprintf(promptbuf, - "\n******** %3ld unread article%c in %s--read now? [%s] ", - (long)toread[ng], (toread[ng]==TR_ONE ? ' ' : 's'), + "\n******** %3ld unread article%s in %s--read now? [%s] ", + (long)toread[ng], (toread[ng]==TR_ONE ? nullstr : "s"), = ngname, dfltcmd); /* format prompt string */ = ELSE @@ -385,6 +409,9 @@ = in_char("\nReally? [ynh] ", 'C'); =#endif - putchar('\n') FLUSH; = setdef(buf,"y"); +#ifdef VERIFY + printcmd(); +#endif + putchar('\n') FLUSH; = if (*buf == 'h') { =#ifdef VERBOSE @@ -590,3 +617,2 @@ = return myngdir; =} - Index: mthreads.c @@ -1,5 +1,9 @@ -/* $Header: mthreads.c,v 4.3.3.2 90/08/20 16:43:19 davison Trn $ +/* $Header: mthreads.c,v 4.3.3.3 91/01/18 19:05:00 davison Trn $ =** =** $Log: mthreads.c,v $ +** Revision 4.3.3.3 91/01/18 19:05:00 davison +** Modified the way signals are handled to avoid endless loops. Added -s & -z +** options. Fixed a truncate bug and a problem with new groups not processing. +** =** Revision 4.3.3.2 90/08/20 16:43:19 davison =** Implemented new command-line interface and database upgrading. @@ -68,6 +72,6 @@ = =bool force_flag = FALSE, kill_mthreads = FALSE, no_processing = FALSE; -bool add_new = FALSE, rebuild = FALSE, grevious_error; -int daemon_delay = 0, log_verbosity = 0, debug = 0; +bool add_new = FALSE, rebuild = FALSE, zap_thread = FALSE, grevious_error; +int daemon_delay = 0, log_verbosity = 0, debug = 0, slow_down = 0; =long expire_time = 0; =char *hierarchy_list = NULL; @@ -99,6 +103,6 @@ =#endif = -char *thread_name(), *file_exp(); -void makethreads(), interrupt(), alarm_handler(), wrap_it_up(); +SIGRET alarm_handler(), int_handler(), severe_handler(); +void makethreads(), wrap_it_up(); = =main( argc, argv ) @@ -168,7 +172,13 @@ = no_processing = TRUE; = break; + case 's': + slow_down++; + break; = case 'v': = log_verbosity++; = break; + case 'z': + zap_thread = TRUE; + break; = default: = fprintf( stderr, "Unknown option: '%c'\n", **argv ); @@ -226,5 +236,6 @@ = } = fclose( fp_lock ); - if( kill( otherpid, kill_mthreads ? SIGTERM : 0 ) == -1 ) { + if( kill( otherpid, kill_mthreads ? SIGTERM : 0 ) == -1 + && errno == ESRCH ) { = if( unlink( filename ) == -1 ) { = fprintf( stderr, "unable to unlink lockfile %s\n", filename ); @@ -260,16 +271,22 @@ = } = +#ifdef SIGHUP = if( sigset( SIGHUP, SIG_IGN ) != SIG_IGN ) { - sigset( SIGHUP, interrupt ); + sigset( SIGHUP, int_handler ); = } +#endif = if( sigset( SIGINT, SIG_IGN ) != SIG_IGN ) { - sigset( SIGINT, interrupt ); + sigset( SIGINT, int_handler ); = } +#ifdef SIGQUIT = if( sigset( SIGQUIT, SIG_IGN ) != SIG_IGN ) { - sigset( SIGQUIT, interrupt ); + sigset( SIGQUIT, int_handler ); = } - sigset( SIGTERM, interrupt ); - sigset( SIGBUS, interrupt ); - sigset( SIGSEGV, interrupt ); +#endif + sigset( SIGTERM, int_handler ); +#ifdef SIGBUS + sigset( SIGBUS, severe_handler ); +#endif + sigset( SIGSEGV, severe_handler ); =#ifdef SIGTTIN = sigset( SIGTTIN, SIG_IGN ); @@ -279,5 +296,6 @@ =#ifdef lint = alarm_handler(); /* foolishness for lint's sake */ - interrupt( 14 ); + int_handler( SIGINT ); + severe_handler( SIGSEGV ); =#endif = @@ -284,5 +302,5 @@ = /* Ensure this machine has the right byte-order for the database */ = filename = file_exp( "%X/db.init" ); - if( (fp_lock = fopen( filename, "r")) == Nullfp + if( (fp_lock = fopen( filename, FOPEN_RB )) == Nullfp = || fread( &mt_bmap, 1, sizeof (BMAP), fp_lock ) < sizeof (BMAP)-1 ) { = if( fp_lock != Nullfp ) { @@ -291,5 +309,5 @@ = write_db_init: = mybytemap( &mt_bmap ); - if( (fp_lock = fopen( filename, "w" )) == Nullfp ) { + if( (fp_lock = fopen( filename, FOPEN_WB )) == Nullfp ) { = log_entry( "Unable to create file: `%s'.\n", filename ); = exit( 1 ); @@ -388,5 +406,5 @@ = for( ;; ) { = if( caught_interrupt ) { - wrap_it_up(); + wrap_it_up( 0 ); = /* NORETURN */ = } @@ -393,5 +411,5 @@ = pause(); /* let alarm go off */ = if( caught_interrupt ) { - wrap_it_up(); + wrap_it_up( 0 ); = /* NORETURN */ = } @@ -400,5 +418,5 @@ = /* Re-open our log file, if needed */ = if( !fp_log && !(fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) { - exit( 1 ); + wrap_it_up( 1 ); = } =#ifndef SERVER @@ -405,5 +423,5 @@ = if( stat( file_exp( ACTIVE ), &filestat ) < 0 ) { = log_entry( "Unable to stat active file -- quitting.\n" ); - exit( 1 ); + wrap_it_up( 1 ); = } =#endif @@ -426,8 +444,8 @@ = }/* if */ = - wrap_it_up(); + wrap_it_up( 0 ); =} = -void +SIGRET =alarm_handler() ={ @@ -435,8 +453,12 @@ =} = -void -interrupt( sig ) +SIGRET +int_handler( sig ) =int sig; ={ + /* Flag interrupt occurred -- main loop attempts an orderly retreat. */ + if( ++caught_interrupt >= 3 ) { + wrap_it_up( 1 ); + } = /* Re-open our log file, if needed */ = if( fp_log || (fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) { @@ -444,5 +466,5 @@ = log_entry( "mthreads halted.\n", sig); = } else { - log_entry( "** interrupt %d **\n", sig); + log_entry( "Interrupt %d received.\n", sig); = } = } @@ -450,14 +472,46 @@ = printf( "interrupt %d!\n", sig ); = } - /* Flag interrupt occurred -- main loop attempts an orderly retreat. */ - caught_interrupt = TRUE; +} + +/* Severe interrupts require severe action -- abort immediately, possibly +** removing the thread file on the way. +*/ +SIGRET +severe_handler( sig ) +int sig; +{ + /* Let's be a bit paranoid here -- avoid any possibility of looping. */ + if( caught_interrupt >= 10 ) { + wrap_it_up( 1 ); + } + caught_interrupt = 10; + + /* Destroy offending thread file if requested to do so. */ + if( zap_thread ) { + unlink( thread_name( line ) ); + } + /* Re-open our log file, if needed */ + if( fp_log || (fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) { + log_error( "** Severe signal: %s **\n", sig ); + if( zap_thread ) { + log_entry( "Destroyed thread file for %s\n", line ); + } + } + if( !daemon_delay ) { + printf( "Severe signal: %s!\n", sig); + if( zap_thread ) { + printf( "Destroyed thread file for %s\n", line ); + } + } + wrap_it_up( 1 ); =} = =void -wrap_it_up() +wrap_it_up( ret ) +int ret; ={ = unlink( file_exp( "%X/LOCKmthreads" ) ); /* remove lock */ = - exit( 0 ); + exit( ret ); =} = @@ -483,5 +537,5 @@ = case ERR_ACCESS: = log_entry( "Server %s rejected connection -- quitting.\n", server ); - exit( 1 ); + wrap_it_up( 1 ); = default: = log_entry( "Couldn't connect with server %s -- sleeping.\n", server ); @@ -497,9 +551,9 @@ = if( (fp_active = fopen( file_exp( ACTIVE1 ), "w+" )) == Nullfp ) { = log_entry( "Unable to write the active1 file.\n" ); - exit( 1 ); + wrap_it_up( 1 ); = } = while( 1 ) { = if( caught_interrupt ) { - wrap_it_up(); + wrap_it_up( 0 ); = /* NORETURN */ = } @@ -520,5 +574,5 @@ = if( (fp_active = fopen( file_exp( ACTIVE ), "r" )) == Nullfp ) { = log_entry( "Unable to open the active file.\n" ); - exit( 1 ); + wrap_it_up( 1 ); = } =#endif @@ -527,5 +581,5 @@ = if( (fp_active3 = fopen( filename, "w" )) == Nullfp ) { = log_entry( "Unable to open the active2 file for update.\n" ); - exit( 1 ); + wrap_it_up( 1 ); = } = } @@ -532,8 +586,8 @@ = if( (fp_active2 = fopen( filename, "r" )) == Nullfp ) { = log_entry( "Unable to open the active2 file.\n" ); - exit( 1 ); + wrap_it_up( 1 ); = } = if( caught_interrupt ) { - wrap_it_up(); + wrap_it_up( 0 ); = /* NORETURN */ = } @@ -564,4 +618,7 @@ = } = } + if( debug || log_verbosity > 3 ) { + log_entry( "Processing %s:\n", line ); + } = data_file_open = 0; = /* If we've allocated some lines in memory while searching for @@ -605,10 +662,11 @@ = ch2 = 'y'; = } else { - total.last = last2 = last; = total.first = first2 = first; = if( add_new ) { + total.last = last2 = first - 1; = ch2 = (ch == '=' ? 'x' : ch); = added_groups++; = } else { + total.last = last2 = last; = ch2 = (ch == '=' ? 'X' : toupper( ch )); = } @@ -677,5 +735,5 @@ = case NG_MATCH: /* add if unthreaded */ = if( ch2 < 'a' ) { - last2 = first2 - 1; + total.last = last2 = first2 - 1; = added_groups++; = } @@ -796,5 +854,5 @@ = update_successful = TRUE; = } else { - strcpy( cp, ".new" ); /* write data as .new */ + strcpy( cp, NEW_THREAD ); /* write data as .new */ = if( write_data( line2 ) && !grevious_error ) { = rename( line2, filename ); @@ -826,4 +884,8 @@ = fprintf( fp_active3, fmt_active2, line, last2, first2, ch2 ); = } + /* If we're not out of sync, keep active2 file flushed. */ + if( !line_root ) { + fflush( fp_active3 ); + } = }/* for */ = @@ -873,4 +935,5 @@ =#endif /* not XENIX */ =#endif /* not TRUNCATE */ + truncate_len = -1; = } = @@ -1063,4 +1126,5 @@ ={ = time_t now; + char *ctime(); = = (void) time( &now ); Index: ndir.h @@ -1,5 +1,8 @@ -/* $Header: ndir.h,v 4.3.2.1 90/04/17 15:28:13 sob Exp $ +/* $Header: ndir.h,v 4.3.3.1 91/01/16 03:18:04 davison Trn $ = * = * $Log: ndir.h,v $ + * Revision 4.3.3.1 91/01/16 03:18:04 davison + * Added optional prototyping. + * = * Revision 4.3.2.1 90/04/17 15:28:13 sob = * Altered to include correct directory include file. @@ -52,10 +55,10 @@ =#define NULL 0 =#endif -extern DIR *opendir(); -extern struct direct *readdir(); -extern long telldir(); -extern void seekdir(); +extern DIR *opendir ANSI((char *)); +extern struct direct *readdir ANSI((DIR *)); +extern long telldir ANSI((DIR *)); +extern void seekdir ANSI((DIR *)); =#define rewinddir(dirp) seekdir((dirp), (long)0) -extern void closedir(); +extern void closedir ANSI((DIR *)); = =# endif Index: newsetup.SH @@ -6,7 +6,13 @@ =$startsh = -# $Header: newsetup.SH,v 4.3.2.7 90/03/17 20:34:48 sob Exp $ +# $Header: newsetup.SH,v 4.3.3.1 91/01/16 03:18:11 davison Trn $ =# =# $Log: newsetup.SH,v $ +# Revision 4.3.3.1 91/01/16 03:18:11 davison +# Integrated rn patches 48-54. +# +# Revision 4.3.2.8 90/11/22 13:26:55 sob +# Purged unneeded code. +# =# Revision 4.3.2.7 90/03/17 20:34:48 sob =# Remove the /tmp/n.* files created when generating the .newsrc. @@ -69,82 +75,4 @@ =#NORMALesac = -: NOTE: SED WILL NOT TAKE MORE THAN 9 WFILES, SO BEWARE - -$sort <\$active | $sed >/tmp/n.tmp\$\$ \\ - -e 's/^\([^ ]*\) .*\$/\1:/' \\ - -e '/^control:/{' \\ - -e " s/:/!/" \\ - -e " w /tmp/n.test\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e '/^junk:/{' \\ - -e " s/:/!/" \\ - -e " w /tmp/n.test\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e '/test:/{' \\ - -e " s/:/!/" \\ - -e " w /tmp/n.test\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^\$locorg\./{" \\ - -e " w /tmp/n.\$locorg\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^\$organization\./{" \\ - -e " w /tmp/n.\$organization\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^\$city\./{" \\ - -e " w /tmp/n.\$city\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^\$cntry\./{" \\ - -e " w /tmp/n.\$cntry\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^\$state\./{" \\ - -e " w /tmp/n.\$state\$\$" \\ - -e ' d' \\ - -e '}' - -$sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$ \\ - -e "/^\$cont\./{" \\ - -e " w /tmp/n.\$cont\$\$" \\ - -e ' d' \\ - -e '}' - -$sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$ \\ - -e "/^to\./{" \\ - -e " s/:/!/" \\ - -e " w /tmp/n.to\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^comp\./{" \\ - -e " w /tmp/n.comp\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^news\./{" \\ - -e " w /tmp/n.news\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^rec\./{" \\ - -e " w /tmp/n.rec\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^sci\./{" \\ - -e " w /tmp/n.sci\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/^soc\./{" \\ - -e " w /tmp/n.soc\$\$" \\ - -e ' d' \\ - -e '}' \\ - -e "/\./{" \\ - -e " w /tmp/n.misc\$\$" \\ - -e ' d' \\ - -e '}' - - =if $test -s \$dotdir/.newsrc ; then = $echo "Saving your current .newsrc as .oldnewsrc..." @@ -156,4 +84,5 @@ =$sed <\$active ' = /^to\./d + / [^mny][^ ]*$/d = s/ .*// = s/^/ / Index: newsgroups.SH @@ -5,7 +5,10 @@ =$spitshell >newsgroups <<!GROK!THIS! =$startsh -# $Header: newsgroups.SH,v 4.3.2.7 90/04/23 19:30:41 sob Exp $ +# $Header: newsgroups.SH,v 4.3.3.1 91/01/16 03:18:14 davison Trn $ =# =# $Log: newsgroups.SH,v $ +# Revision 4.3.3.1 91/01/16 03:18:14 davison +# Integrated rn patches 48-54. +# =# Revision 4.3.2.7 90/04/23 19:30:41 sob =# Extra space removed to make second part of newsgroups work. Index: ng.c @@ -1,5 +1,8 @@ -/* $Header: ng.c,v 4.3.3.2 90/08/20 16:03:45 davison Trn $ +/* $Header: ng.c,v 4.3.3.3 91/01/16 03:18:16 davison Trn $ = * = * $Log: ng.c,v $ + * Revision 4.3.3.3 91/01/16 03:18:16 davison + * Integrated rn patches 48-54. Fixed in_char/verify interaction. + * = * Revision 4.3.3.2 90/08/20 16:03:45 davison = * Fixed bug in backpage code. @@ -8,4 +11,10 @@ = * Initial Trn Release = * + * Revision 4.3.2.9 91/01/05 14:56:47 sob + * Removed bogus "fast skip" for NNTP. + * + * Revision 4.3.2.8 90/11/22 16:14:17 sob + * Added changes to accomodate picky C preprocessors + * = * Revision 4.3.2.7 90/04/21 14:44:23 sob = * Revised previous patch insure that it does not decrement below zero. @@ -148,5 +157,5 @@ = char ser_line[256]; = char artname[32]; - static long our_pid; + static long our_pid=0; =#endif /* SERVER */ = char oldmode = mode; @@ -382,4 +391,8 @@ = printf("End of %s",ngname); =#endif +#ifdef USETHREADS + if (ThreadedGroup) + ucount -= unthreaded; +#endif = if (ucount) { =#ifdef USETHREADS @@ -443,7 +456,5 @@ = fputs("Skipping",stdout); =#endif - for (i = just_a_sec/3; i; --i) - putchar(PC); - fflush(stdout); + pad(just_a_sec/3); = sleep(1); = break; @@ -467,24 +478,5 @@ = art = newart - 1; = } -#endif -#else - { - char ser_line[256]; - ART_NUM newart; - - put_server("NEXT"); - if (get_server(ser_line, sizeof (ser_line)) < 0) { - fprintf(stderr, - "rrn: unexpected close of server socket.\n"); - finalize(1); - } - if (ser_line[0] != CHAR_OK) - newart = lastart + 1; - else - newart = atoi(ser_line+4); - for (i=art; i<newart; i++) - oneless(i); - art = newart - 1; - } +#endif /* READDIR */ =#endif /* SERVER */ = break; @@ -737,5 +729,4 @@ = reask_unread: = in_char(u_prompt,'u'); - putchar('\n') FLUSH; = setdef(buf,dfltcmd); =#ifdef VERIFY @@ -742,4 +733,5 @@ = printcmd(); =#endif + putchar('\n') FLUSH; = if (*buf == 'h') { = fputs(u_help_thread,stdout); @@ -1225,5 +1217,4 @@ = in_char("\nReally? [ynh] ", 'C'); =#endif - putchar('\n') FLUSH; = setdef(buf,"y"); =#ifdef VERIFY @@ -1230,4 +1221,5 @@ = printcmd(); =#endif + putchar('\n') FLUSH; = if (*buf == 'h') { =#ifdef VERBOSE Index: ng.h @@ -1,5 +1,8 @@ -/* $Header: ng.h,v 4.3 85/05/01 11:44:29 lwall Exp $ +/* $Header: ng.h,v 4.3.3.1 91/01/16 03:18:20 davison Trn $ = * = * $Log: ng.h,v $ + * Revision 4.3.3.1 91/01/16 03:18:20 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:44:29 lwall = * Baseline for release with 4.3bsd. @@ -28,9 +31,9 @@ =#define NG_MINUS 2 = -void ng_init(); -int do_newsgroup(); -int art_switch(); +void ng_init ANSI((void)); +int do_newsgroup ANSI((char *)); +int art_switch ANSI((void)); =#ifdef MAILCALL - void setmail(); + void setmail ANSI((void)); =#endif -void setdfltcmd(); +void setdfltcmd ANSI((void)); Index: ngdata.c @@ -1,8 +1,14 @@ -/* $Header: ngdata.c,v 4.3.3.1 90/07/21 20:28:27 davison Trn $ +/* $Header: ngdata.c,v 4.3.3.2 91/01/16 03:18:21 davison Trn $ = * = * $Log: ngdata.c,v $ + * Revision 4.3.3.2 91/01/16 03:18:21 davison + * Integrated rn patches 48-54. Fixed bug in ZEROGLOB code. + * = * Revision 4.3.3.1 90/07/21 20:28:27 davison = * Initial Trn Release = * + * Revision 4.3.2.11 90/11/22 16:14:34 sob + * Added changes to accomodate picky C preprocessors + * = * Revision 4.3.2.10 90/04/14 22:05:15 sob = * Removed redundant declaration of active_name @@ -70,6 +76,9 @@ =#ifdef ZEROGLOB =# ifdef CACHEFIRST + { + int i; = for (i=0; i<MAXRCLINE; i++) = abs1st[i] = 0; + } =# endif =#endif /* ZEROGLOB */ Index: ngdata.h @@ -1,5 +1,8 @@ -/* $Header: ngdata.h,v 4.3.3.1 90/06/20 22:38:50 davison Trn $ +/* $Header: ngdata.h,v 4.3.3.2 91/01/16 03:18:22 davison Trn $ = * = * $Log: ngdata.h,v $ + * Revision 4.3.3.2 91/01/16 03:18:22 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:38:50 davison = * Initial Trn Release @@ -37,7 +40,7 @@ =#endif = -void ngdata_init(); -ART_NUM getngsize(); -ACT_POS findact(); -ART_NUM getabsfirst(); -ART_NUM getngmin(); +void ngdata_init ANSI((void)); +ART_NUM getngsize ANSI((NG_NUM)); +ACT_POS findact ANSI((char *,char *,int,long)); +ART_NUM getabsfirst ANSI((NG_NUM,ART_NUM)); +ART_NUM getngmin ANSI((char *,ART_NUM)); Index: ngsrch.h @@ -1,5 +1,8 @@ -/* $Header: ngsrch.h,v 4.3 85/05/01 11:44:56 lwall Exp $ +/* $Header: ngsrch.h,v 4.3.3.1 91/01/16 03:18:24 davison Trn $ = * = * $Log: ngsrch.h,v $ + * Revision 4.3.3.1 91/01/16 03:18:24 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:44:56 lwall = * Baseline for release with 4.3bsd. @@ -16,10 +19,10 @@ =#endif = -void ngsrch_init(); +void ngsrch_init ANSI((void)); =#ifdef NGSEARCH - int ng_search(); - bool ng_wanted(); + int ng_search ANSI((char *,int)); + bool ng_wanted ANSI((void)); =#endif =#ifdef NGSORONLY - char *ng_comp(); + char *ng_comp ANSI((COMPEX *,char *,bool,bool)); =#endif Index: ngstuff.c @@ -1,5 +1,8 @@ -/* $Header: ngstuff.c,v 4.3.3.2 90/08/20 18:29:08 davison Trn $ +/* $Header: ngstuff.c,v 4.3.3.3 91/01/16 03:18:25 davison Trn $ = * = * $Log: ngstuff.c,v $ + * Revision 4.3.3.3 91/01/16 03:18:25 davison + * Changed some expressions to registers to bypass a compiler problem. + * = * Revision 4.3.3.2 90/08/20 18:29:08 davison = * Expanded path arrays for consistancy. @@ -360,12 +363,14 @@ =#ifdef USETHREADS = else if (ch == '+') { + register char mask = unread_selector+1; = find_article(art); - if (p_art && !(selected_roots[p_art->root] & (unread_selector+1))) { - selected_roots[p_art->root] |= (unread_selector+1); + if (p_art && !(selected_roots[p_art->root] & mask)) { + register int r = p_art->root; + selected_roots[r] |= mask; = selected_root_cnt++; = if (mode == 't') { - selected_count += root_article_cnts[p_art->root]; + selected_count += root_article_cnts[r]; = } else { - selected_count += count_one_root(p_art->root); + selected_count += count_one_root(r); =#ifdef VERBOSE = IF(verbose) @@ -376,13 +381,15 @@ = } = else if (ch == '-') { + register char mask = unread_selector+1; = find_article(art); = if (p_art && selected_root_cnt - && (selected_roots[p_art->root] & (unread_selector+1))) { - selected_roots[p_art->root] &= ~(unread_selector+1); + && (selected_roots[p_art->root] & mask)) { + register int r = p_art->root; + selected_roots[r] &= ~mask; = selected_root_cnt--; = if (mode == 't') { - selected_count -= root_article_cnts[p_art->root]; + selected_count -= root_article_cnts[r]; = } else { - selected_count -= count_one_root(p_art->root); + selected_count -= count_one_root(r); =#ifdef VERBOSE = IF(verbose) Index: ngstuff.h @@ -1,5 +1,8 @@ -/* $Header: ngstuff.h,v 4.3.3.1 90/06/20 22:39:07 davison Trn $ +/* $Header: ngstuff.h,v 4.3.3.2 91/01/16 03:18:27 davison Trn $ = * = * $Log: ngstuff.h,v $ + * Revision 4.3.3.2 91/01/16 03:18:27 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:39:07 davison = * Initial Trn Release @@ -17,7 +20,10 @@ =EXT bool one_command INIT(FALSE); /* no ':' processing in perform() */ = -void ngstuff_init(); -int escapade(); -int switcheroo(); -int numnum(); -int perform(); +void ngstuff_init ANSI((void)); +int escapade ANSI((void)); +int switcheroo ANSI((void)); +int numnum ANSI((void)); +int perform ANSI((char *,int)); +#ifdef USETHREADS +int use_selected ANSI((void)); +#endif Index: norm.saver.SH @@ -5,7 +5,10 @@ =$spitshell >norm.saver <<!GROK!THIS! =$startsh -# $Header: norm.saver.SH,v 4.3.2.1 89/11/28 00:08:01 sob Locked $ +# $Header: norm.saver.SH,v 4.3.2.2 90/11/22 15:44:06 sob Exp $ =# =# $Log: norm.saver.SH,v $ +# Revision 4.3.2.2 90/11/22 15:44:06 sob +# Changed . config.sh to . ./config.sh +# =# Revision 4.3.2.1 89/11/28 00:08:01 sob =# Branch for RN/RRN combo. Index: only.c @@ -1,7 +1,13 @@ -/* $Header: only.c,v 4.3.3.1 90/06/20 22:39:13 davison Trn $ +/* $Header: only.c,v 4.3.3.2 91/01/16 03:26:16 davison Trn $ = * = * $Log: only.c,v $ + * Revision 4.3.3.2 91/01/16 03:26:16 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:39:13 davison = * Initial Trn Release + * + * Revision 4.3.2.1 90/11/22 16:11:20 sob + * Added changes to accomodate pickly C preprocessors. = * = * Revision 4.3 85/05/01 11:45:21 lwall Index: only.h @@ -1,5 +1,8 @@ -/* $Header: only.h,v 4.3 85/05/01 11:45:27 lwall Exp $ +/* $Header: only.h,v 4.3.3.1 91/01/16 03:26:16 davison Trn $ = * = * $Log: only.h,v $ + * Revision 4.3.3.1 91/01/16 03:26:16 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:45:27 lwall = * Baseline for release with 4.3bsd. @@ -21,9 +24,9 @@ = /* >0 => # of entries in ngtodo */ = -void only_init(); -bool inlist(); /* return TRUE if ngname is in command line list */ +void only_init ANSI((void)); +bool inlist ANSI((char *)); /* return TRUE if ngname is in command line list */ = /* or if there was no list */ -void setngtodo(); +void setngtodo ANSI((char *)); =#ifdef ONLY - void end_only(); + void end_only ANSI((void)); =#endif Index: Pnews.SH @@ -5,7 +5,10 @@ =$spitshell >Pnews <<!GROK!THIS! =$startsh -# $Header: Pnews.SH,v 4.3.3.2 90/08/20 16:24:09 davison Trn $ +# $Header: Pnews.SH,v 4.3.3.3 91/01/16 03:27:15 davison Trn $ =# =# $Log: Pnews.SH,v $ +# Revision 4.3.3.3 91/01/16 03:27:15 davison +# Integrated rn patches 48-54. +# =# Revision 4.3.3.2 90/08/20 16:24:09 davison =# Use mbox.saver for AUTHORCOPY. Fixed sitename handling. @@ -14,4 +17,28 @@ =# Initial Trn Release =# +# Revision 4.3.2.14 91/01/05 15:18:19 sob +# Changed the header purge code to use sed instead of grep. +# +# Revision 4.3.2.13 90/12/30 03:47:57 sob +# Changed "hidden" to "hiddennet" to be like nntp and bnews. +# Made it possible to cancel articles if hiddennet is defined. +# +# Revision 4.3.2.12 90/12/30 03:27:44 sob +# Corrected a spelling problem. +# +# Revision 4.3.2.11 90/12/04 02:47:54 sob +# Added a fix to remove blank lines in the header before posting. +# +# Revision 4.3.2.10 90/11/22 13:45:40 sob +# Added support for making news posting appear to come from the domain +# itself instead of individual hosts withing a domain. +# +# Revision 4.3.2.9 90/11/06 00:54:52 sob +# Added ./ to be beginning of config.sh +# +# Revision 4.3.2.8 90/11/06 00:08:11 sob +# Fixed bug in sed syntax for usg password file format per bug report by +# prc@erbe.se +# =# Revision 4.3.2.7 90/05/04 23:14:45 sob =# Expires: line removed from Pnews.header. @@ -94,4 +121,11 @@ =esac = +case $hiddennet in +define) sitename="$domain" + ;; +*) + ;; +esac + =# your organization name =orgname="$orgname" @@ -126,4 +160,5 @@ =tr=${tr-tr} =inews=${inews-inews} +nidump=${nidump} =ypmatch=${ypmatch} = @@ -240,5 +275,5 @@ =shift =if $test $# -gt 0 ; then - dist=$1 + dist=$1.whatever =else = set X $hdr_newsgroups @@ -245,5 +280,5 @@ = shift = if $test $# -gt 0 ; then - dist=$1 + dist=$1.whatever = else = dist=misc.whatever @@ -250,4 +285,11 @@ = fi =fi +case $dist in +*.*) + ;; +*) + dist=$dist.whatever + ;; +esac = =# tell them what we think they are doing... !DIST! @@ -292,5 +334,5 @@ = ;; =to.*) - $echo 'This program may post news to a partcular machine.' + $echo 'This program may post news to a particular machine.' = ;; =*) @@ -495,5 +537,6 @@ = case "$tryinews" in = yes) - if $inews -h < $tmpart ; then + if $sed '1,/^[ ]*$/{/^[A-Z][-A-Za-z0-9]*:[ ]*$/d;}' $tmpart | + $inews -h ; then = : null = else @@ -693,10 +736,12 @@ =case ${NAME-$nametype} in =bsd) - if $test "$ypmatch" != ""; then - fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/"` - fi + if $test "$ypmatch" != ""; then + fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/"` + elif $test "$nidump" != ""; then + fullname=`$nidump passwd / | $sed -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"` + fi = if $test "$fullname" = ""; then - fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"` - fi + fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"` + fi = case $fullname in = *'&'*) : GACK @@ -708,10 +753,10 @@ = ;; =usg) - if $test "$ypmatch" != ""; then - fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q"` - fi + if $test "$ypmatch" != ""; then + fullname=`$ypmatch $logname passwd 2>/dev/null | $sed -e "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q"` + fi = if $test "$fullname" = ""; then = fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q" -e "}" -e "d"` - fi + fi = ;; =*) @@ -728,4 +773,5 @@ =Newsgroups: $ng =Subject: $title +Summary: =Reply-To: $REPLYTO =Followup-To: $follow Index: rcln.h @@ -1,5 +1,8 @@ -/* $Header: rcln.h,v 4.3.3.1 90/08/20 16:47:22 davison Trn $ +/* $Header: rcln.h,v 4.3.3.2 91/01/16 03:28:33 davison Trn $ = * = * $Log: rcln.h,v $ + * Revision 4.3.3.2 91/01/16 03:28:33 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/08/20 16:47:22 davison = * Removed ngmax array. @@ -14,13 +17,13 @@ =#endif = -void rcln_init(); +void rcln_init ANSI((void)); =#ifdef CATCHUP - void catch_up(); + void catch_up ANSI((NG_NUM)); =#endif -int addartnum(); +int addartnum ANSI((ART_NUM,char *)); =#ifdef MCHASE - void subartnum(); + void subartnum ANSI((ART_NUM,char *)); =#endif -void prange(); -void set_toread(); -void checkexpired(); +void prange ANSI((char *,ART_NUM,ART_NUM)); +void set_toread ANSI((NG_NUM)); +void checkexpired ANSI((NG_NUM,ART_NUM)); Index: rcstuff.c @@ -1,5 +1,8 @@ -/* $Header: rcstuff.c,v 4.3.3.2 90/08/20 16:47:44 davison Trn $ +/* $Header: rcstuff.c,v 4.3.3.3 91/01/16 03:28:34 davison Trn $ = * = * $Log: rcstuff.c,v $ + * Revision 4.3.3.3 91/01/16 03:28:34 davison + * Integrated rn patches 48-54. Fixed in_char and verify interaction. + * = * Revision 4.3.3.2 90/08/20 16:47:44 davison = * Removed ngmax array. @@ -8,4 +11,27 @@ = * Initial Trn Release = * + * Revision 4.3.2.12 90/12/12 03:05:15 sob + * Adds "N" command to compliment the "Y" command when prompted for adding + * new newsgroups. + * + * Revision 4.3.2.11 90/11/22 17:49:57 sob + * Fixed "Y" for regular rn users (non-NNTP). + * + * Revision 4.3.2.10 90/11/22 13:53:26 sob + * Made changes to keep more preprocessors happy. + * + * Revision 4.3.2.9 90/11/06 01:04:39 sob + * Updated help messages to include new Y command when adding new newsgroups. + * + * Revision 4.3.2.8 90/10/30 23:26:43 sob + * Changes to restore .newsrc when exiting rn and diskspace runs out while + * updating .newsrc. + * + * Revision 4.3.2.7 90/10/30 22:47:49 sob + * A bit of cleanup. + * + * Revision 4.3.2.6 90/09/04 23:36:32 sob + * Changed "add" to "subscribe" to actually reflect what is being done. + * = * Revision 4.3.2.5 90/05/04 00:44:07 sob = * Fixes to add_newsgroup() from lar@usl.edu. @@ -266,7 +292,8 @@ =/* assumes that we are chdir'ed to SPOOL */ = -#ifdef SERVER +#define ADDNEW_SUB 1 +#define ADDNEW_UNSUB 2 + =static int addnewbydefault = 0; -#endif /* SERVER */ = =bool @@ -328,22 +355,23 @@ = return FALSE; = } -#ifdef SERVER = if (addnewbydefault) { - printf("(Adding %s to end of your .newsrc)\n", ngname); - ng = add_newsgroup(ngname, ':'); + printf("(Adding %s to end of your .newsrc %ssubscribed)\n", + ngname, (addnewbydefault == ADDNEW_SUB) ? "" : "un"); + if (addnewbydefault == ADDNEW_SUB) + ng = add_newsgroup(ngname, ':'); + else + ng = add_newsgroup(ngname, '!'); = do_reloc = FALSE; = } else { -#endif /* SERVER */ =#ifdef VERBOSE = IF(verbose) - sprintf(promptbuf,"\nNewsgroup %s not in .newsrc--add? [yn] ",ngname); + sprintf(promptbuf,"\nNewsgroup %s not in .newsrc--subscribe? [ynYN] ",ngname); = ELSE =#endif =#ifdef TERSE - sprintf(promptbuf,"\nAdd %s? [yn] ",ngname); + sprintf(promptbuf,"\nSubscribe %s? [ynY] ",ngname); =#endif =reask_add: = in_char(promptbuf,'A'); - putchar('\n') FLUSH; = setdef(buf,"y"); =#ifdef VERIFY @@ -350,8 +378,9 @@ = printcmd(); =#endif + putchar('\n') FLUSH; = if (*buf == 'h') { =#ifdef VERBOSE = IF(verbose) - printf("Type y or SP to add %s to your .newsrc.\n", ngname) + printf("Type y or SP to add %s to your .newsrc.\nType Y to add all new groups to the end of your .newsrc.\nType N to add all new groups to the end of your .newsrc unsubscribed.\n", ngname) = FLUSH; = ELSE @@ -358,5 +387,5 @@ =#endif =#ifdef TERSE - fputs("y or SP to add\n",stdout) FLUSH; + fputs("y or SP to add, Y to add all new groups, N to add all new groups unsubscribed\n",stdout) FLUSH; =#endif = fputs(ntoforget,stdout) FLUSH; @@ -371,14 +400,22 @@ = do_reloc = FALSE; = } -#ifdef SERVER = else if (*buf == 'Y') { = fputs( - "(I'll add all new newsgroups to the end of your .newsrc.)\n", stdout); - addnewbydefault = 1; - printf("(Adding %s to end of your .newsrc)\n", ngname); + "(I'll add all new newsgroups (subscribed) to the end of your .newsrc.)\n", + stdout); + addnewbydefault = ADDNEW_SUB; + printf("(Adding %s to end of your .newsrc subscribed)\n", ngname); = ng = add_newsgroup(ngname, ':'); = do_reloc = FALSE; = } -#endif /* SERVER */ + else if (*buf == 'N') { + fputs( + "(I'll add all new newsgroups (unsubscribed) to the end of your .newsrc.)\n", + stdout); + addnewbydefault = ADDNEW_UNSUB; + printf("(Adding %s to end of your .newsrc unsubscribed)\n", ngname); + ng = add_newsgroup(ngname, '!'); + do_reloc = FALSE; + } = else { = fputs(hforhelp,stdout) FLUSH; @@ -386,7 +423,5 @@ = goto reask_add; = } -#ifdef SERVER = } -#endif /* SERVER */ = } = else if (rcchar[ng] == NEGCHAR) { /* unsubscribed? */ @@ -404,5 +439,4 @@ =reask_unsub: = in_char(promptbuf,'R'); - putchar('\n') FLUSH; = setdef(buf,"y"); =#ifdef VERIFY @@ -409,4 +443,5 @@ = printcmd(); =#endif + putchar('\n') FLUSH; = if (*buf == 'h') { =#ifdef VERBOSE @@ -541,5 +576,4 @@ = reask_reloc: = unflush_output(); /* disable any ^O in effect */ -#ifdef SERVER = if (addnewbydefault) { = buf[0] = '$'; @@ -546,5 +580,4 @@ = buf[1] = '\0'; = } else { -#endif /* SERVER */ =#ifdef VERBOSE = IF(verbose) @@ -559,7 +592,5 @@ = eat_typeahead(); = getcmd(buf); -#ifdef SERVER = } -#endif /* SERVER */ = if (errno || *buf == '\f') { = /* if return from stop signal */ @@ -623,5 +654,5 @@ = } = else if (*buf == '$') { - putchar('\n') FLUSH; + if (! addnewbydefault) putchar('\n') FLUSH; = return nextrcline-1; = } @@ -811,5 +842,4 @@ =reask_bogus: = in_char("Delete bogus newsgroups? [ny] ", 'D'); - putchar('\n') FLUSH; = setdef(buf,"n"); =#ifdef VERIFY @@ -816,4 +846,5 @@ = printcmd(); =#endif + putchar('\n') FLUSH; = if (*buf == 'h') { =#ifdef VERBOSE @@ -924,6 +955,5 @@ =#ifdef VERBOSE = IF(verbose) - fputs("\ -Trying to set up a .newsrc file--running newsetup...\n\n\ + fputs("\nTrying to set up a .newsrc file--running newsetup...\n\n\ =",stdout) FLUSH; = ELSE @@ -936,6 +966,5 @@ =#ifdef VERBOSE = IF(verbose) - fputs("\ -Can't create a .newsrc--you must do it yourself.\n\ + fputs("\nCan't create a .newsrc--you must do it yourself.\n\ =",stdout) FLUSH; = ELSE @@ -980,5 +1009,12 @@ = printf("%s\n",rcline[tmpng]) FLUSH; =#endif - fprintf(rcfp,"%s\n",rcline[tmpng]); + if (fprintf(rcfp,"%s\n",rcline[tmpng]) < 0){ + printf("Can't recreate .newsrc\n") FLUSH; + fclose(rcfp); /* close .newsrc */ + UNLINK(rctname); + finalize(1); + } + + ; = if (delim) = *delim = '\0'; /* might still need this line */ @@ -1007,4 +1043,8 @@ ={ = UNLINK(rctname); +#ifdef RENAME + rename(rcname,rctname); + rename(rcbname,rcname); +#else = link(rcname,rctname); = UNLINK(rcname); @@ -1011,3 +1051,4 @@ = link(rcbname,rcname); = UNLINK(rcbname); +#endif =} Index: rcstuff.h @@ -1,5 +1,8 @@ -/* $Header: rcstuff.h,v 4.3 85/05/01 11:46:49 lwall Exp $ +/* $Header: rcstuff.h,v 4.3.3.1 91/01/16 03:28:37 davison Trn $ = * = * $Log: rcstuff.h,v $ + * Revision 4.3.3.1 91/01/16 03:28:37 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:46:49 lwall = * Baseline for release with 4.3bsd. @@ -24,16 +27,16 @@ =EXT bool paranoid INIT(FALSE); /* did we detect some inconsistency in .newsrc? */ = -bool rcstuff_init(); -bool get_ng(); /* return TRUE if newsgroup can be found or added */ -NG_NUM add_newsgroup(); +bool rcstuff_init ANSI((void)); +bool get_ng ANSI((char *,bool)); /* return TRUE if newsgroup can be found or added */ +NG_NUM add_newsgroup ANSI((char *,char)); =#ifdef RELOCATE - NG_NUM relocate_newsgroup(); /* move newsgroup around */ + NG_NUM relocate_newsgroup ANSI((NG_NUM,NG_NUM));/* move newsgroup around */ =#endif -void list_newsgroups(); -NG_NUM find_ng(); /* return index of newsgroup */ -void cleanup_rc(); -void sethash(); -int hash(); -void newsrc_check(); -void write_rc(); -void get_old_rc(); +void list_newsgroups ANSI((void)); +NG_NUM find_ng ANSI((char *)); /* return index of newsgroup */ +void cleanup_rc ANSI((void)); +void sethash ANSI((NG_NUM)); +int hash ANSI((char *)); +void newsrc_check ANSI((void)); +void write_rc ANSI((void)); +void get_old_rc ANSI((void)); Index: respond.c @@ -1,8 +1,14 @@ -/* $Header: respond.c,v 4.3.3.1 90/07/21 20:30:18 davison Trn $ +/* $Header: respond.c,v 4.3.3.2 91/01/16 03:28:40 davison Trn $ = * = * $Log: respond.c,v $ + * Revision 4.3.3.2 91/01/16 03:28:40 davison + * Integrated rn patches 48-54. Changed fseek to allow for NL_SIZE. + * = * Revision 4.3.3.1 90/07/21 20:30:18 davison = * Initial Trn Release = * + * Revision 4.3.2.4 90/11/22 16:09:04 sob + * Added changes to accomodate pickly C preprocessors + * = * Revision 4.3.2.3 90/03/22 23:05:19 sob = * Fixes provided by Wayne Davison <drivax!davison> @@ -166,5 +172,5 @@ = || strnEQ(art_buf, "cat ", 4) = || strnEQ(art_buf, "echo ", 5)) { - fseek(artfp,(long)-strlen(art_buf),1); + fseek(artfp,(long)-strlen(art_buf)-NL_SIZE+1,1); = savefrom = ftell(artfp); = if (cmdstr) { @@ -202,5 +208,5 @@ = extractprog = savestr("-"); = cnt = 0; - fseek(artfp,(long)-strlen(art_buf),1); + fseek(artfp,(long)-strlen(art_buf)-NL_SIZE+1,1); = savefrom = ftell(artfp); = uud_start(s); Index: respond.h @@ -1,5 +1,8 @@ -/* $Header: respond.h,v 4.3.3.1 90/06/20 22:39:54 davison Trn $ +/* $Header: respond.h,v 4.3.3.2 91/01/16 03:28:41 davison Trn $ = * = * $Log: respond.h,v $ + * Revision 4.3.3.2 91/01/16 03:28:41 davison + * Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:39:54 davison = * Initial Trn Release @@ -18,8 +21,8 @@ =#define SAVE_DONE 1 = -void respond_init(); -int save_article(); -int cancel_article(); -void reply(); -void followup(); -void invoke(); +void respond_init ANSI((void)); +int save_article ANSI((void)); +int cancel_article ANSI((void)); +void reply ANSI((void)); +void followup ANSI((void)); +void invoke ANSI((char *,char *)); Index: rn.h @@ -1,5 +1,8 @@ -/* $Header: rn.h,v 4.3 85/05/01 11:48:19 lwall Exp $ +/* $Header: rn.h,v 4.3.3.1 91/01/16 03:28:44 davison Trn $ = * = * $Log: rn.h,v $ + * Revision 4.3.3.1 91/01/16 03:28:44 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:48:19 lwall = * Baseline for release with 4.3bsd. @@ -17,6 +20,6 @@ =EXT char *spool INIT(Nullch); /* public news spool directory */ = -void rn_init(); -void main(); -void set_ngname(); -char *getngdir(); +void rn_init ANSI((void)); +void main ANSI((int,char **)); +void set_ngname ANSI((char *)); +char *getngdir ANSI((char *)); Index: Rnmail.SH @@ -5,7 +5,10 @@ =$spitshell >Rnmail <<!GROK!THIS! =$startsh -# $Header: Rnmail.SH,v 4.3.3.2 90/08/20 16:22:29 davison Trn $ +# $Header: Rnmail.SH,v 4.3.3.3 91/01/16 03:28:46 davison Trn $ =# =# $Log: Rnmail.SH,v $ +# Revision 4.3.3.3 91/01/16 03:28:46 davison +# Integrated rn patches 48-54. +# =# Revision 4.3.3.2 90/08/20 16:22:29 davison =# Use mbox.saver for MAILRECORD. Fixed sitename handling. @@ -14,4 +17,12 @@ =# Initial Trn Release =# +# Revision 4.3.2.3 90/12/30 03:48:04 sob +# Changed "hidden" to "hiddennet" to be like nntp and bnews. +# Made it possible to cancel articles if hiddennet is defined. +# +# Revision 4.3.2.2 90/11/22 14:00:21 sob +# Support added for hiding all hosts within a domain such that mail appears +# to come for user@domainname only. +# =# Revision 4.3.2.1 89/11/06 00:30:54 sob =# Added RRN support from NNTP 1.5 @@ -61,4 +72,12 @@ =undef) sitename="$sitename" ;; =esac + +case $hiddennet in +define) sitename="$domain" + ;; +*) + ;; +esac + =# your organization name =orgname="$orgname" @@ -69,4 +88,6 @@ =# default editor =defeditor="$defeditor" +# where the non-publics are +rnlib=$rnlib =# how not to do a newline with echo =n="$n" @@ -271,9 +292,9 @@ = send) = if $test -f $dotdir/.signature; then - echo $n "Append .signature file? [y] $c" + $echo $n "Append .signature file? [y] $c" = read ans = case $ans in = ''|y*) - echo "-- " >> $tmpart + $echo "-- " >> $tmpart = cat $dotdir/.signature >> $tmpart = ;; Index: rt-select.c @@ -1,5 +1,9 @@ -/* $Header: rt-select.c,v 4.3.3.2 90/08/20 18:32:33 davison Trn $ +/* $Header: rt-select.c,v 4.3.3.3 91/01/16 03:28:50 davison Trn $ =** =** $Log: rt-select.c,v $ +** Revision 4.3.3.3 91/01/16 03:28:50 davison +** Changed %d --> %ld. +** Changed some expressions to registers to bypass a compiler problem. +** =** Revision 4.3.3.2 90/08/20 18:32:33 davison =** Reset scan_all_roots while selecting. @@ -280,7 +284,8 @@ = strcpy( promptbuf, "-- Select threads -- " ); = if( i != max_root ) { - sprintf( promptbuf+21, "%s%d%% [%c%c] --", + sprintf( promptbuf+21, "%s%ld%% [%c%c] --", = (!page_root? "Top " : nullstr), - running_total*100 / article_count, page_char, end_char ); + (long)(running_total*100 / article_count), + page_char, end_char ); = } else { = sprintf( promptbuf+21, "%s [%c%c] --", @@ -423,4 +428,7 @@ = } = do { + register int r; + register char maskr = mask; + r = root_hold[cur_root]; = if( can_home ) { = goto_line( screen_line, root_line[cur_root] ); @@ -429,5 +437,5 @@ = putchar( select_chars[cur_root] ); = if( action == '@' ) { - if( selected_roots[root_hold[cur_root]] & 4 ) { + if( selected_roots[r] & 4 ) { = ch = (unread_selector ? '+' : ' '); = } else if( unread_selector ) { @@ -434,5 +442,5 @@ = ch = 'k'; = } else - if( selected_roots[root_hold[cur_root]] & mask ) { + if( selected_roots[r] & maskr ) { = ch = '-'; = } else { @@ -444,9 +452,8 @@ = switch( ch ) { = case '+': - if( !(selected_roots[root_hold[cur_root]] & mask) ) { - selected_roots[root_hold[cur_root]] |= mask; + if( !(selected_roots[r] & maskr) ) { + selected_roots[r] |= maskr; = selected_root_cnt++; - selected_count - += root_article_cnts[root_hold[cur_root]]; + selected_count += root_article_cnts[r]; = putchar( '+' ); = } @@ -453,6 +460,6 @@ = /* FALL THROUGH */ = case 'm': - if( selected_roots[root_hold[cur_root]] & 4 ) { - selected_roots[root_hold[cur_root]] &= ~4; + if( selected_roots[r] & 4 ) { + selected_roots[r] &= ~4; = if( ch == 'm' ) { = putchar( ' ' ); @@ -463,6 +470,6 @@ = break; = case 'k': - if( !(selected_roots[root_hold[cur_root]] & 4) ) { - selected_roots[root_hold[cur_root]] |= 4; + if( !(selected_roots[r] & 4) ) { + selected_roots[r] |= 4; = putchar( '-' ); = } @@ -470,9 +477,8 @@ = case '-': = unsel: - if( selected_roots[root_hold[cur_root]] & mask ) { - selected_roots[root_hold[cur_root]] &= ~mask; + if( selected_roots[r] & maskr ) { + selected_roots[r] &= ~maskr; = selected_root_cnt--; - selected_count - -= root_article_cnts[root_hold[cur_root]]; + selected_count -= root_article_cnts[r]; = if( ch != 'k' ) { = putchar( ' ' ); @@ -662,7 +668,8 @@ = } else if( ch == '\r' || ch == '\n' ) { = if( !selected_root_cnt ) { - selected_roots[root_hold[cur_root]] = mask; + register r = root_hold[cur_root]; + selected_roots[r] = mask; = selected_root_cnt++; - selected_count += root_article_cnts[root_hold[cur_root]]; + selected_count += root_article_cnts[r]; = } = } @@ -880,5 +887,6 @@ = } = if( ++artp == root_limit ) { - int root_num = artp[-1].root; + register int root_num = artp[-1].root; + register char maskr = mask; = = root_article_cnts[root_num] = count; @@ -885,5 +893,5 @@ = if( count ) { = article_count += count; - if( selected_roots[root_num] & mask ) { + if( selected_roots[root_num] & maskr ) { = selected_roots[root_num] &= ~4; = selected_root_cnt++; @@ -892,6 +900,6 @@ = last_root = root_num; = } else if( do_unselect ) { - selected_roots[root_num] &= ~mask; - } else if( selected_roots[root_num] & mask ) { + selected_roots[root_num] &= ~maskr; + } else if( selected_roots[root_num] & maskr ) { = selected_roots[root_num] &= ~4; = selected_root_cnt++; Index: rthreads.c @@ -1,5 +1,8 @@ -/* $Header: rthreads.c,v 4.3.3.2 90/08/20 16:58:14 davison Trn $ +/* $Header: rthreads.c,v 4.3.3.3 91/01/16 03:28:53 davison Trn $ =** =** $Log: rthreads.c,v $ +** Revision 4.3.3.3 91/01/16 03:28:53 davison +** Changed Free to safefree. Tweaked fopen for possible binary open mode. +** =** Revision 4.3.3.2 90/08/20 16:58:14 davison =** Added message for missing/bad db.init file. @@ -24,5 +27,5 @@ =static int read_item(); =static void wp_bmap(), lp_bmap(); -static void Free(); +static void safefree(); = =/* Initialize our thread code by determining the byte-order of the thread @@ -38,5 +41,5 @@ = word_same = long_same = TRUE; = filename = filexp( "%X/db.init" ); - if( (fp_in = fopen( filename, "r" )) != Nullfp ) { + if( (fp_in = fopen( filename, FOPEN_RB )) != Nullfp ) { = if( fread( &mt_bmap, 1, sizeof (BMAP), fp_in ) >= sizeof (BMAP)-1 ) { = if( mt_bmap.version != DB_VERSION ) { @@ -77,5 +80,5 @@ = register char *ptr; = - if( (fp_in = fopen( threadname, "r" )) == Nullfp ) { + if( (fp_in = fopen( threadname, FOPEN_RB )) == Nullfp ) { = if (errno != ENOENT) { = printf( "\n\nOpen failed for thread data -- continuing unthreaded.\n" ); @@ -151,5 +154,5 @@ = } = count_roots( !saved_selections ); - Free( &saved_selections ); + safefree( &saved_selections ); = select_page = 0; = return 1; @@ -178,5 +181,5 @@ =*/ =static void -Free( pp ) +safefree( pp ) =char **pp; ={ @@ -213,14 +216,14 @@ = selected_root_cnt = selected_count = 0; = } - Free( &p_roots ); - Free( &root_subjects ); - Free( &author_cnts ); - Free( &subject_cnts ); - Free( &author_ptrs ); - Free( &subject_ptrs ); - Free( &root_article_cnts ); - Free( &selected_roots ); - Free( &p_articles ); - Free( &strings ); + safefree( &p_roots ); + safefree( &root_subjects ); + safefree( &author_cnts ); + safefree( &subject_cnts ); + safefree( &author_ptrs ); + safefree( &subject_ptrs ); + safefree( &root_article_cnts ); + safefree( &selected_roots ); + safefree( &p_articles ); + safefree( &strings ); = = p_art = curr_p_art = Nullart; Index: rthreads.h @@ -1,5 +1,8 @@ -/* $Header: rthreads.h,v 4.3.3.1 90/06/20 22:56:01 davison Trn $ +/* $Header: rthreads.h,v 4.3.3.2 91/01/16 03:28:54 davison Trn $ =** =** $Log: rthreads.h,v $ +** Revision 4.3.3.2 91/01/16 03:28:54 davison +** Added optional prototyping. +** =** Revision 4.3.3.1 90/06/20 22:56:01 davison =** Initial Trn Release @@ -36,14 +39,23 @@ =EXT BMAP my_bmap, mt_bmap; = -void thread_init(), mybytemap(); -char *thread_name(), *safemalloc(); -int use_data(); -void unuse_data(); -void find_article(), init_tree(), entire_tree(); -int tree_puts(), finish_tree(); -void first_art(), follow_thread(), next_root(), prev_root(); -char select_thread(); -int count_roots(), count_one_root(); -PACKED_ARTICLE *upper_limit(); +void thread_init ANSI((void)); +void mybytemap ANSI((BMAP *)); +char *thread_name ANSI((char *)); +char *safemalloc ANSI((MEM_SIZE)); +int use_data ANSI((char *)); +void unuse_data ANSI((bool)); +void find_article ANSI((ART_NUM)); +void init_tree ANSI((void)); +void entire_tree ANSI((void)); +int tree_puts ANSI((char *,ART_LINE,int)); +int finish_tree ANSI((ART_LINE)); +void first_art ANSI((void)); +void follow_thread ANSI((char)); +void next_root ANSI((void)); +void prev_root ANSI((void)); +char select_thread ANSI((char)); +int count_roots ANSI((bool)); +int count_one_root ANSI((int)); +PACKED_ARTICLE *upper_limit ANSI((PACKED_ARTICLE *,bool)); = =#define Nullart Null(PACKED_ARTICLE*) Index: search.h @@ -1,5 +1,8 @@ -/* $Header: search.h,v 4.3 85/05/01 11:50:46 lwall Exp $ +/* $Header: search.h,v 4.3.3.1 91/01/16 03:37:37 davison Trn $ = * = * $Log: search.h,v $ + * Revision 4.3.3.1 91/01/16 03:37:37 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:50:46 lwall = * Baseline for release with 4.3bsd. @@ -24,14 +27,14 @@ =} COMPEX; = -void search_init(); -void init_compex(); -void free_compex(); -char *getbracket(); -void case_fold(); -char *compile(); -void grow_eb(); -char *execute(); -bool advance(); -bool backref(); -bool cclass(); +void search_init ANSI((void)); +void init_compex ANSI((COMPEX *)); +void free_compex ANSI((COMPEX *)); +char *getbracket ANSI((COMPEX *,int)); +void case_fold ANSI((int)); +char *compile ANSI((COMPEX *,char *,int,int)); +void grow_eb ANSI((COMPEX *)); +char *execute ANSI((COMPEX *,char *)); +bool advance ANSI((COMPEX *,char *,char *)); +bool backref ANSI((COMPEX *,int,char *)); +bool cclass ANSI((char *,int,int)); =#endif Index: sw.c @@ -1,7 +1,13 @@ -/* $Header: sw.c,v 4.3.3.1 90/06/20 22:40:11 davison Trn $ +/* $Header: sw.c,v 4.3.3.2 91/01/16 03:37:38 davison Trn $ = * = * $Log: sw.c,v $ + * Revision 4.3.3.2 91/01/16 03:37:38 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.1 90/06/20 22:40:11 davison = * Initial Trn Release + * + * Revision 4.3.2.4 90/11/22 16:09:19 sob + * Added changes to accomodate pickly C preprocessors = * = * Revision 4.3.2.3 90/05/08 22:06:00 sob Index: sw.h @@ -1,5 +1,8 @@ -/* $Header: sw.h,v 4.3 85/05/01 11:51:07 lwall Exp $ +/* $Header: sw.h,v 4.3.3.1 91/01/16 03:37:39 davison Trn $ = * = * $Log: sw.h,v $ + * Revision 4.3.3.1 91/01/16 03:37:39 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:51:07 lwall = * Baseline for release with 4.3bsd. @@ -11,8 +14,8 @@ =#endif = -void sw_init(); -void sw_file(); -void sw_list(); -void decode_switch(); -void pr_switches(); -void cwd_check(); +void sw_init ANSI((int,char **,char **)); +void sw_file ANSI((char **,bool)); +void sw_list ANSI((char *)); +void decode_switch ANSI((char *)); +void pr_switches ANSI((void)); +void cwd_check ANSI((void)); Index: term.c @@ -1,8 +1,29 @@ -/* $Header: term.c,v 4.3.3.1 90/07/28 18:09:09 davison Trn $ +/* $Header: term.c,v 4.3.3.2 91/01/16 03:38:36 davison Trn $ = * = * $Log: term.c,v $ + * Revision 4.3.3.2 91/01/16 03:38:36 davison + * Integrated rn patches 48-54. Revised 8-bit character support. + * = * Revision 4.3.3.1 90/07/28 18:09:09 davison = * Initial Trn Release = * + * Revision 4.3.2.13 90/12/12 03:03:28 sob + * Lost a closing paren in circfill() + * + * Revision 4.3.2.12 90/12/10 01:33:54 sob + * First attempts to make rn "8 bit clean" + * + * Revision 4.3.2.11 90/11/22 13:34:06 sob + * Added a change to circfill to make it work with POSIX-compliant OSes. + * + * Revision 4.3.2.10 90/11/05 23:41:29 sob + * Now it's gone. + * + * Revision 4.3.2.9 90/11/05 23:30:07 sob + * moved the winsize struct in anticipation of removing it. + * + * Revision 4.3.2.8 90/10/01 01:43:59 sob + * Fixed syntax error pointed out by stealth@m-net.ann-arbor.mi.us. + * = * Revision 4.3.2.7 90/04/21 16:54:29 sob = * Installed patches provided by SCO for SCO Xenix @@ -52,9 +73,4 @@ =#include "term.h" = -#ifdef SYS_PTEM -#include <sys/stream.h> -#include <sys/ptem.h> -#endif - =char ERASECH; /* rubout character */ =char KILLCH; /* line delete character */ @@ -159,12 +175,4 @@ = 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 @@ -222,4 +230,5 @@ = if (!*CE || !*CD || !can_home) /* can we CE, CD, and home? */ = can_home_clear = FALSE; /* no, so disable use of clear eol */ + if (!*CE) CE = CD; =#endif /* CLEAREOL */ =#ifdef USETHREADS @@ -463,5 +472,5 @@ = do { = top: - if ((unsigned char)*s < ' ') { + if (*(unsigned char *)s < ' ') { = putchar('^'); = putchar(*s | 64); @@ -525,5 +534,5 @@ = rubout(); = s--; /* discount the char rubbed out */ - if ((unsigned char)*s < ' ' || *s == '\177') + if (*(unsigned char *)s < ' ' || *s == '\177') = rubout(); = if (s == buf) { /* entire string gone? */ @@ -537,5 +546,5 @@ = while (s-- != buf) { /* emulate that many ERASEs */ = rubout(); - if ((unsigned char)*s < ' ' || *s == '\177') + if (*(unsigned char *)s < ' ' || *s == '\177') = rubout(); = } @@ -552,5 +561,5 @@ = return FALSE; /* return to single char mode */ = } - if ((unsigned char)*s < ' ' || *s == '\177') + if (*(unsigned char *)s < ' ' || *s == '\177') = rubout(); = } @@ -640,6 +649,11 @@ =circfill() ={ - register int Howmany = read(devtty,circlebuf+nextin,1); + register int Howmany; = + errno = 0; + Howmany = read(devtty,circlebuf+nextin,1); + + if (Howmany < 0 && (errno == EAGAIN || errno == EINTR)) + Howmany = 0; = if (Howmany) { = nextin += Howmany; @@ -699,5 +713,5 @@ = if (*UC) { /* char by char underline? */ = while (*s) { - if ((unsigned char)*s < ' ') { + if (*(unsigned char *)s < ' ') { = putchar('^'); = backspace();/* back up over it */ @@ -718,5 +732,5 @@ = underline(); /* start underlining */ = while (*s) { - if ((unsigned char)*s < ' ') { + if (*(unsigned char *)s < ' ') { = putchar('^'); = putchar(*s+64); @@ -776,8 +790,9 @@ = int_count = 0; = errno = 0; - if (read_tty(whatbuf,1) < 0) + if (read_tty(whatbuf,1) < 0){ = if (!errno) = errno = EINTR; - else { + if (errno == EINTR) + return; = perror(readerr); = sig_catcher(0); @@ -1002,5 +1017,5 @@ = if (!*s) = break; - if ((unsigned char)*s >= ' ') + if (*(unsigned char *)s >= ' ') = putchar(*s); = else if (*s == '\t') { @@ -1060,5 +1075,5 @@ ={ = if (verify && buf[1] == FINISHCMD) { - if ((unsigned char)*buf < ' ') { + if (*(unsigned char *)buf < ' ') { = putchar('^'); = putchar(*buf | 64); @@ -1090,5 +1105,5 @@ = fputs("^R\n",stdout) FLUSH; = for (s = buf; *s; s++) { - if ((unsigned char)*s < ' ') { + if (*(unsigned char *)s < ' ') { = putchar('^'); = putchar(*s | 64); Index: term.h @@ -1,8 +1,23 @@ -/* $Header: term.h,v 4.3.3.1 90/06/20 22:40:34 davison Trn $ +/* $Header: term.h,v 4.3.3.2 91/01/16 03:38:39 davison Trn $ = * = * $Log: term.h,v $ + * Revision 4.3.3.2 91/01/16 03:38:39 davison + * Integrated rn patches 48-54. Added optional prototyping. + * = * Revision 4.3.3.1 90/06/20 22:40:34 davison = * Initial Trn Release = * + * Revision 4.3.2.6 90/12/10 01:32:08 sob + * Hopefully, the rn -e -L problem is now fixed. + * + * Revision 4.3.2.5 90/11/22 13:48:09 sob + * Backed out change in Patch 48. + * + * Revision 4.3.2.4 90/11/05 23:54:49 sob + * changed maybe_eol to test when erase_screen is FALSE intstead of TRUE. + * + * Revision 4.3.2.3 90/10/01 01:49:39 sob + * Changed ospeed from short to long. + * = * Revision 4.3.2.2 90/04/06 20:35:34 sob = * Added fixes for SCO Xenix sent by ronald@robobar.co.uk. @@ -161,8 +176,10 @@ =EXT char *CL INIT(Nullch); /* home and clear screen */ =EXT char *CE INIT(Nullch); /* clear to end of line */ +#if defined(CLEAREOL) || defined(USETHREADS) +EXT char *CM INIT(Nullch); /* cursor motion */ +EXT char *HO INIT(Nullch); /* home cursor */ +#endif =#ifdef CLEAREOL -EXT char *CM INIT(Nullch); /* cursor motion -- PWP */ -EXT char *HO INIT(Nullch); /* home cursor -- PWP */ -EXT char *CD INIT(Nullch); /* clear to end of display -- PWP */ +EXT char *CD INIT(Nullch); /* clear to end of display */ =#endif /* CLEAREOL */ =EXT char *SO INIT(Nullch); /* begin standout mode */ @@ -176,5 +193,5 @@ =EXT bool XN INIT(FALSE); /* does it eat 1st newline after automatic wrap? */ =EXT char PC INIT(0); /* pad character for use by tputs() */ -EXT short ospeed INIT(0); /* terminal output speed, for use by tputs() */ +EXT long ospeed INIT(0); /* terminal output speed, for use by tputs() */ =EXT int LINES INIT(0), COLS INIT(0); /* size of screen */ =EXT int just_a_sec INIT(960); /* 1 sec at current baud rate */ @@ -187,5 +204,5 @@ =#define erase_eol() tputs(CE,1,putchr) FLUSH =#ifdef CLEAREOL -#define clear_rest() tputs(CD,LINES,putchr) FLUSH /* PWP */ +#define clear_rest() tputs(CD,LINES,putchr) FLUSH =#define maybe_eol() if(erase_screen&&can_home_clear)tputs(CE,1,putchr) FLUSH =#endif /* CLEAREOL */ @@ -204,40 +221,40 @@ =EXT int page_line INIT(1); /* line number for paging in print_line (origin 1) */ = -void term_init(); -void term_set(); +void term_init ANSI((void)); +void term_set ANSI((char *)); =#ifdef PUSHBACK -void pushchar(); -void mac_init(); -void mac_line(); -void show_macros(); +void pushchar ANSI((char)); +void mac_init ANSI((char *)); +void mac_line ANSI((char *,char *,int)); +void show_macros ANSI((void)); =#endif -char putchr(); /* routine for tputs to call */ -bool finish_command(); -void eat_typeahead(); -void settle_down(); +char putchr ANSI((char)); /* routine for tputs to call */ +bool finish_command ANSI((int)); +void eat_typeahead ANSI((void)); +void settle_down ANSI((void)); =#ifndef read_tty - int read_tty(); + int read_tty ANSI((char *,int)); =#endif -void underprint(); +void underprint ANSI((char *)); =#ifdef NOFIREWORKS - void no_sofire(); - void no_ulfire(); + void no_sofire ANSI((void)); + void no_ulfire ANSI((void)); =#endif -void getcmd(); -int get_anything(); -void in_char(); -int print_lines(); -void page_init(); -void pad(); -void printcmd(); -void rubout(); -void reprint(); +void getcmd ANSI((char *)); +int get_anything ANSI((void)); +void in_char ANSI((char *,char)); +int print_lines ANSI((char *,int)); +void page_init ANSI((void)); +void pad ANSI((int)); +void printcmd ANSI((void)); +void rubout ANSI((void)); +void reprint ANSI((void)); =#if defined(CLEAREOL) || defined(USETHREADS) -void home_cursor(); +void home_cursor ANSI((void)); =#endif =#ifdef USETHREADS -void goto_line(); +void goto_line ANSI((int,int)); =#endif =#ifdef SIGWINCH -int winch_catcher(); +int winch_catcher ANSI((void)); =#endif /* SIGWINCH */ Index: trn.1 @@ -1,5 +1,8 @@ -''' $Header: trn.1,v 4.3.3.2 90/08/20 16:50:51 davison Trn $ +''' $Header: trn.1,v 4.3.3.3 91/01/16 03:38:44 davison Trn $ =''' =''' $Log: trn.1,v $ +''' Revision 4.3.3.3 91/01/16 03:38:44 davison +''' Integrated rn patches 48-54. +''' =''' Revision 4.3.3.2 90/08/20 16:50:51 davison =''' Changed email address. @@ -8,4 +11,14 @@ =''' Initial Trn Release =''' +''' Revision 4.3.2.2 90/12/12 03:48:54 sob +''' Added documentation for the new "N" command at startup newsgroup +''' selection. +''' +''' Revision 4.3.2.1 90/11/26 02:12:34 sob +''' Added information about environmental variables NEWSRC and NNTPSERVER. +''' +''' Revision 4.3.1.10 90/11/06 01:17:29 sob +''' Added text about new Y response when adding newsgroups. +''' =''' Revision 4.3.1.9 90/05/08 22:05:11 sob =''' Added documentation for new -q flag @@ -348,5 +361,9 @@ =not, will not be listed. =If any new newsgroups are found, you will be asked for each one whether -you would like to add it. +you would like to add it. If you want to add all new newsgroups, you can +type \*(L'Y\*(R' and they will be added the the end of the +.I .newsrc +file and as groups you want to read. If you don't want to subscribe, all +the new groups can be added by typing \*(L'N\*(R'. =After any new newsgroups have been added, the \*(L'a\*(R' command also =restricts the current set of newsgroups just like the \*(L'o\*(R' command @@ -1895,4 +1912,14 @@ =.Sp =Default: Pnews \-h %h +.Ip NEWSRC 8 +Your newsgroup subscription list. +.Sp +Default: $HOME/.newsrc +.Ip NNTPSERVER 8 +The hostname of your NNTPSERVER. [This does not apply unless you are running +the NNTP version of rn.] +.Sp +Default: the hostname listed in the server file, usually +/usr/local/lib/rn/server. =.Ip NOPOSTRING 8 =The string to insert in the group summary line, which heads each article, Index: util.c @@ -1,5 +1,8 @@ -/* $Header: util.c,v 4.3.3.2 90/08/20 16:51:44 davison Trn $ +/* $Header: util.c,v 4.3.3.3 91/01/16 03:41:50 davison Trn $ = * = * $Log: util.c,v $ + * Revision 4.3.3.3 91/01/16 03:41:50 davison + * Integrated rn patches 48-54. + * = * Revision 4.3.3.2 90/08/20 16:51:44 davison = * Fixed getcwd call to not overflow any buffers. @@ -8,4 +11,11 @@ = * Initial Trn Release = * + * Revision 4.3.2.8 90/11/22 13:54:06 sob + * Made changes to keep more preprocessors happy. + * + * Revision 4.3.2.7 90/10/01 01:52:18 sob + * Altered the preprocessor defines on GETWD/GETCWD per suggestion by + * rsm@math.arizona.edu. + * = * Revision 4.3.2.6 90/04/23 00:24:42 sob = * A bit of clean up. @@ -57,5 +67,4 @@ ={ = int status, pid, w; - SIGRET (*signal())(); = char *shell; = @@ -86,5 +95,7 @@ = } = signal(SIGINT, SIG_IGN); +#ifdef SIGQUIT = signal(SIGQUIT, SIG_IGN); +#endif = waiting = TRUE; = while ((w = wait(&status)) != pid && w != -1) @@ -94,5 +105,7 @@ = waiting = FALSE; = sigset(SIGINT, int_catcher); /* always catch interrupts */ +#ifdef SIGQUIT = signal(SIGQUIT, SIG_DFL); +#endif =#ifdef SIGTSTP = sigset(SIGTSTP,stop_catcher); @@ -258,4 +271,5 @@ = * Get working directory = */ +#ifndef GETWD =#ifdef GETCWD =char * @@ -269,5 +283,4 @@ =} =#else -#ifndef GETWD =char * =getwd(np) /* shorter but slower */ Index: util.h @@ -1,5 +1,8 @@ -/* $Header: util.h,v 4.3 85/05/01 11:51:58 lwall Exp $ +/* $Header: util.h,v 4.3.3.1 91/01/16 03:41:51 davison Trn $ = * = * $Log: util.h,v $ + * Revision 4.3.3.1 91/01/16 03:41:51 davison + * Added optional prototyping. + * = * Revision 4.3 85/05/01 11:51:58 lwall = * Baseline for release with 4.3bsd. @@ -17,25 +20,23 @@ =#define MD_FILE 1 = -void util_init(); -int doshell(); -char *safemalloc(); -char *saferealloc(); -char *safecpy(); -char *safecat(); -char *cpytill(); -char *instr(); +void util_init ANSI((void)); +int doshell ANSI((char *,char *)); +char *safemalloc ANSI((MEM_SIZE)); +char *saferealloc ANSI((char *,MEM_SIZE)); +char *safecpy ANSI((char *,char *,int)); +char *safecat ANSI((char *,char *,int)); +char *cpytill ANSI((char *,char *,int)); +char *instr ANSI((char *,char *)); =#ifdef SETUIDGID - int eaccess(); + int eaccess ANSI((char *,int)); =#endif -char *getwd(); -void cat(); -void prexit(); -char *get_a_line(); -char *savestr(); -int makedir(); -void setenv(); -int envix(); -void notincl(); -char *getval(); -void growstr(); -void setdef(); +char *getwd ANSI((char *)); +char *get_a_line ANSI((char *,int,FILE *)); +char *savestr ANSI((char *)); +int makedir ANSI((char *,int)); +void setenv ANSI((char *,char *)); +int envix ANSI((char *)); +void notincl ANSI((char *)); +char *getval ANSI((char *,char *)); +void growstr ANSI((char **,int *,int)); +void setdef ANSI((char *,char *)); Index: uudecode.c @@ -1,5 +1,8 @@ -/* $Header: uudecode.c,v 4.3.3.1 90/06/20 22:48:21 davison Trn $ +/* $Header: uudecode.c,v 4.3.3.2 91/01/16 03:41:52 davison Trn $ =** =** $Log: uudecode.c,v $ +** Revision 4.3.3.2 91/01/16 03:41:52 davison +** Tweaked fopen for possible binary open mode. +** =** Revision 4.3.3.1 90/06/20 22:48:21 davison =** Initial Trn Release @@ -126,5 +129,5 @@ = strcpy(dest, uu_fname); = - if ((uu_out = fopen(dest, "w")) == Nullfp) { + if ((uu_out = fopen(dest, FOPEN_WB)) == Nullfp) { = printf("Cannot create file: %s\n", dest); = goto err; Index: uudecode.h @@ -1,5 +1,8 @@ -/* $Header: uudecode.h,v 4.3.3.1 90/06/20 22:49:08 davison Trn $ +/* $Header: uudecode.h,v 4.3.3.2 91/01/16 03:41:53 davison Trn $ =** =** $Log: uudecode.h,v $ +** Revision 4.3.3.2 91/01/16 03:41:53 davison +** Added optional prototyping. +** =** Revision 4.3.3.1 90/06/20 22:49:08 davison =** Initial Trn Release @@ -9,2 +12,6 @@ =EXT FILE *uu_out INIT(NULL); =EXT char uu_fname[MAXFILENAME]; + +int uud_start ANSI((char *)); +int uud_send ANSI((void)); +int uudecode ANSI((FILE *)); SHAR_EOF fi exit 0 # End of shell archive ----8<------8<------8<------8<-----the end------>8------>8------>8------>8----