Article View: news.software.readers
Article #927Trn 2 patch #2
From: Wayne Davison
Date: Tue, 10 Dec 1991 05:29
Date: Tue, 10 Dec 1991 05:29
864 lines
25689 bytes
25689 bytes
Here is trn 2's patch #2 (which generates trn 2.2). To apply it, use this
file with a unified version of Larry Wall's patch program (such as 12u5),
or use the unidiff filter with an older version of patch (such as PL12).
For example, to apply this from trn with an old version of patch, you could
type "| unipatch | patch -d /the/dir/for/trn2". You will have had to have
previously done a "make unipatch", and installed both unipatch and patch
on your path somewhere.
From outside of trn, use:
cd /the/dir/for/trn2
patch <this_file (or "unipatch <this_file | patch")
Then:
Configure
make depend
make
make install
This patch fixes some portability problems, squashes some bugs, and adds
a couple minor improvements:
o More upgrade notes for trn 1.x users (see ** LOOK ** in NEW).
o Enhanced the article-reading code to not remember our side-trip
to the end of the group between thread selections (to fix '-').
o Extended trrn's handling of new articles (we fetch the active file
more consistently, and listen to what the GROUP command tells us).
o Enhanced the thread selector to mention when new articles have
cropped up since the last visit to the selector.
o Changed strftime to use size_t and added a check for size_t in
Configure to make sure it is defined. Also made it a bit more
portable by using gettimeofday() and timezone() in some instances.
o Fixed a problem with the "total" structure not getting zero'ed in
mthreads (causing bogus 'E'rrors on null groups).
o Fixed a reference to tmpbuf in intrp.c that was bogus.
o Fixed a problem with using N and Y with the newgroup code and then
trying to use the 'a' command.
o Fixed an instance where having trrn get ahead of the active file
might declare a group as being reset when it wasn't.
o Reorganized the checks for Apollo's C library to make sure it doesn't
find the Domain OS version.
o Added a check for Xenix 386's C library.
o Made the Configure PATH more portable.
o Fixed the arguments prototypes to int_catcher() and swinch_catcher().
o Fixed the insert-my-subject-before-my-sibling code to not do this
when the sibling's subject is the same as the parent.
o Fixed a bug in the RELAY code (which I'm suprised is still being used).
o Twiddled the mthreads.8 manpage.
o mthreads.8 is now installed and the destination is prompted for in
Configure, since it might be different from the .1 destination.
o Fixed a typo in newsnews.SH and the README.
--
\ /| / /|\/ /| /(_) Wayne Davison
(_)/ |/ /\|/ / |/ \ davison@borland.com
(W A Y N e)
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: patchlevel
Prereq: v2.1
@@ -1,1 +1,1 @@
-trn v2.1
+trn v2.2
Index: Configure
@@ -102,4 +102,6 @@
mansrc=''
manext=''
+mtmansrc=''
+mtmanext=''
maildir=''
spool=''
@@ -126,4 +128,5 @@
uselect=''
strftime=''
+foundsizet=''
xnxlib=''
chsize=''
@@ -175,5 +178,5 @@
: sanity checks
-PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/bsd'
+PATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:/usr/bsd"
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
@@ -323,23 +326,27 @@
fi
else
- if test -f /lib/libc; then
- echo "Your C library is in /lib/libc. This might be Domain/OS."
- libc=/lib/libc
+ if test -f /lib/clib; then
+ echo "Your C library is in /lib/clib. How nonstandard, must be Apollo."
+ libc=/lib/clib
else
- if test -f /lib/Llibc.a; then
- echo "Your C library is in /lib/Llibc.a. I smell Xenix!"
- libc=/lib/Llibc.a
- else
- if test -f /usr/lib/libc.a; then
- echo "Your C library is in /usr/lib/libc.a, of all places."
- libc=/usr/lib/libc.a
- if test -f /usr/lib/libc_s.a; then
- echo "You also have AT&T shared libraries, we'll use those."
- sharedclib=-lc_s
- fi
+ if test -f /lib/libc; then
+ echo "Your C library is in /lib/libc. This might be Domain/OS."
+ libc=/lib/libc
+ else
+ if test -f /lib/386/Slibc.a; then
+ echo "Your C library is in /lib/386/Slibc.a. I smell Xenix 386!"
+ libc=/lib/386/Slibc.a
else
- if test -f /lib/clib; then
- echo "Your C library is in /lib/clib. How nonstandard, must be Apollo."
- libc=/lib/clib
+ if test -f /lib/Llibc.a; then
+ echo "Your C library is in /lib/Llibc.a. I smell Xenix!"
+ libc=/lib/Llibc.a
+ else
+ if test -f /usr/lib/libc.a; then
+ echo "Your C library is in /usr/lib/libc.a, of all places."
+ libc=/usr/lib/libc.a
+ if test -f /usr/lib/libc_s.a; then
+ echo "You also have AT&T shared libraries, we'll use those."
+ sharedclib=-lc_s
+ fi
else
if test -f "$libc"; then
@@ -358,4 +365,5 @@
fi
fi
+ fi
fi
fi
@@ -387,5 +395,5 @@
echo "done"
else
- sed -n -e 's/^.* D _//p' -e 's/^.* D //p' < nm.list > libc.list
+ sed -n -e 's/^.* [AD] _//p' -e 's/^.* [AD] //p' < nm.list > libc.list
if $contains '^printf$' libc.list >/dev/null 2>&1; then
echo "done"
@@ -1316,5 +1324,5 @@
esac
$echo " "
- $echo $n "Where do the manual pages (source) go? [$dflt] $c"
+ $echo $n "Where do user manual pages (source) go? [$dflt] $c"
. myread
mansrc=`filexp "$ans"`
@@ -1324,14 +1332,38 @@
done
case "$mansrc" in
-*l)
- manext=l
- ;;
-*n)
- manext=n
+*l) manext=l ;;
+*L) manext=L ;;
+*n) manext=n ;;
+*) manext=1 ;;
+esac
+case "$mtmansrc" in
+'') case "$manext" in
+ '1') dflt="`dirname $mansrc`/`basename $mansrc 1`8" ;;
+ *) dflt="$mansrc"
+ esac
;;
-*)
- manext=1
+*) dflt="$mtmansrc"
;;
esac
+mtmansrc='blurfl/dyick'
+while $test ! -d "$mtmansrc" ; do
+ case $mtmansrc in
+ blurfl*) ;;
+ *) $echo "$mtmansrc does not appear to exist." ;;
+ esac
+ $echo " "
+ $echo $n "Where should the mthreads.8 manpage (source) go? [$dflt] $c"
+ . myread
+ mtmansrc=`filexp "$ans"`
+ case $mtmansrc in
+ '') mtmansrc=$dflt ;;
+ esac
+done
+case "$mtmansrc" in
+*l) mtmanext=l ;;
+*L) mtmanext=L ;;
+*n) mtmanext=n ;;
+*) mtmanext=8 ;;
+esac
: determine where mail is spooled
@@ -1893,4 +1925,9 @@
strftime='undef'
fi
+if $contains 'size_t' /usr/include/string*.h >/dev/null 2>&1 ; then
+ foundsizet='define'
+else
+ foundsizet='undef'
+fi
: see if YP could be running here
@@ -3058,4 +3095,6 @@
mansrc='$mansrc'
manext='$manext'
+mtmansrc='$mtmansrc'
+mtmanext='$mtmanext'
maildir='$maildir'
spool='$spool'
@@ -3082,4 +3121,5 @@
uselect='$uselect'
strftime='$strftime'
+foundsizet='$foundsizet'
xnxlib='$xnxlib'
chsize='$chsize'
Index: Makefile.SH
@@ -36,4 +36,6 @@
mansrc = $mansrc
manext = $manext
+#MTmtmansrc = $mtmansrc
+#MTmtmanext = $mtmanext
#NNTPNNTPDIR = $NNTPSRC
#NNTPNNTPINC = $rrninclude
@@ -159,4 +161,7 @@
#NNTPecho ".so man$(manext)/trn.$(manext)" > $(mansrc)/trrn.$(manext) ; \
fi
+#MT - if test `pwd` != $(mtmansrc); then \
+#MTcp mthreads.8 $(mtmansrc)/mthreads.$(mtmanext); \
+#MTfi
clean:
Index: NEW
@@ -89,5 +89,5 @@
-Slight incompatibility in mthreads: ** LOOK **
+Slight incompatibilities in mthreads: ** LOOK **
o Since the -D option in mthreads was busted (it processed all groups
@@ -109,4 +109,18 @@
do the processing ("mthreads -dave" for example). See the man page
(which is now in its proper group: '8') for full details.
+ o ALSO, using an old mthreads database with trn will cause trn to ignore
+ all the xref lines (which are used to mark cross-posted articles as
+ read). This is because the new mthreads marks xref-containing articles
+ so that trn can junk articles faster. If you don't have the time or
+ resources to destroy the old database and rebuild it with the new
+ mthreads, put the -o2 option in your global INIT file for a few
+ weeks -- you can remove it once the old article data has expired
+ (if you begin using the new mthreads, of course).
+ o NOTE that the new mthreads puts its db.init file in the root of the
+ thread directory (which might be SPOOL). You should copy or move
+ your db.init file from RNLIB to THREADDIR, just in case your database
+ is REALLY old (and so that your trn will find it).
+ o I also recommend destroying your old active2 file and regenerating
+ it with a command like: "mthreads all".
Changes to mthreads:
Index: README
@@ -55,5 +55,5 @@
have access to a thread database. This can either be maintained locally
via an NNTP version of mthreads, shared via NFS, or accessed remotely via
-the XTHREAD extention to NNTP. See the file nntp/xthread.patch for details
+the XTHREAD extension to NNTP. See the file nntp/xthread.patch for details
about modifying NNTP 1.5.11 into an XTHREAD-compatible version.
@@ -146,5 +146,7 @@
just to see if things are working, and then add more hierarchies with a
command like "mthreads news". To turn on all groups, use the command
- "mthreads all" (one time). See the man page for details.
+ "mthreads all" (one time). See the man page for details. People
+ upgrading from trn 1.x need to read the ** LOOK ** section in the file
+ NEW.
10) Arrange to have the mthreads command of your choosing run on a regular
Index: addng.c
@@ -294,5 +294,5 @@
#ifdef SERVER /* ngsize not used */
- int x,tot,min,max;
+ long tot;
sprintf(tst,"GROUP %s",ngnam);
#ifdef DEBUGGING
@@ -307,5 +307,5 @@
#endif
if (*tst != CHAR_OK) return(0); /* not a real group */
- (void) sscanf(tst,"%d%d%d%d",&x,&tot,&min,&max);
+ (void) sscanf(tst,"%*d%ld",&tot);
if (tot > 0) return(time(Null(long *)));
else return(0);
Index: bits.c
@@ -504,5 +504,5 @@
#ifndef NORELAY
rver_buf = fetchlines(artnum,RVER_LINE);
- if ((t = instr(rver_buf,"; site "), TRUE) == Nullch)
+ if ((t = instr(rver_buf,"; site ", TRUE)) == Nullch)
#else /* NORELAY */
/* In version 2.10.3 of news or afterwards, the Relay-Version
Index: config.h.SH
@@ -144,4 +144,5 @@
#$uselect USELECT /* should we use select to emulate usleep? */
#$strftime STRFTIME /* is strftime() available? */
+#$foundsizet FOUNDSIZET /* is size_t around? */
#$chsize CHSIZE /* is chsize() available? */
#$tzset TZSET /* modern timezone functions? */
Index: final.c
@@ -120,5 +120,6 @@
SIGRET
-int_catcher()
+int_catcher(dummy)
+int dummy;
{
sigset(SIGINT,int_catcher);
Index: final.h
@@ -36,5 +36,5 @@
/* signal catching routines */
-SIGRET int_catcher ANSI((void));
+SIGRET int_catcher ANSI((int));
SIGRET sig_catcher ANSI((int));
#ifdef SIGTSTP
Index: intrp.c
@@ -1190,5 +1190,5 @@
if ((c = index(s, '-')) != Nullch)
s = c;
- strcpy(buf,tmpbuf);
+ strcpy(buf,s);
#endif
#ifdef GETPWENT
Index: mt-process.c
@@ -1200,5 +1200,6 @@
/* Find the subject of any pre-existing children or siblings. We want
** to insert the new subject before one of these to keep the numbering
- ** intuitive in the newsreader.
+ ** intuitive in the newsreader. Never insert prior to our parent's
+ ** subject, however.
*/
for (node = article->children; node; node = node->children) {
@@ -1212,4 +1213,12 @@
sib_subj = node->subject;
break;
+ }
+ }
+ if (article->parent) {
+ if (article->parent->subject == child_subj) {
+ child_subj = Null(SUBJECT*);
+ }
+ if (article->parent->subject == sib_subj) {
+ sib_subj = Null(SUBJECT*);
}
}
Index: mt-write.c
@@ -71,4 +71,5 @@
write_ids();
free_leftovers();
+ bzero(&total, sizeof (TOTAL));
if (failure != 2) {
Index: mthreads.8
@@ -250,7 +250,7 @@
\&'X' = group excluded in active2
.br
- \&'*' = chdir failed (might be ok)
+ \&'*' = unable to access a group
.br
- \&'!' = write failed (is NOT ok)
+ \&'!' = write failed (bad news)
.br
\&'e' = informational error
Index: newsnews.SH
@@ -11,5 +11,5 @@
page(s). There are some important things to remember, though:
- * Trn is an extention of rn. Where possible, the command syntax is the same.
+ * Trn is an extension of rn. Where possible, the command syntax is the same.
* To access all the new features, specify the options -x and -X. These
options MAY be on by default, but it won't hurt to be redundant.
Index: ng.c
@@ -166,4 +166,13 @@
return (-1);
}
+ {
+ long first, last;
+
+ (void) sscanf(ser_line,"%*d%*d%ld%ld",&first,&last);
+ ngmax[ng] = last; /* ensure getngsize() knows the new maximum */
+# ifdef CACHEFIRST
+ abs1st[ng] = first;
+# endif
+ }
#else /* not SERVER */
if (eaccess(ngdir,5)) { /* directory read protected? */
@@ -229,4 +238,5 @@
if (use_threads) /* grab thread data */
ThreadedGroup = use_data(ThreadedGroup);
+ added_articles = -1;
#endif
@@ -285,10 +295,10 @@
#ifdef USETHREADS
if (ThreadedGroup) {
+ ART_NUM oldlast = lastart;
+
if ((art > lastart || forcegrow) && getngsize(ng) > total.last) {
- if (art > lastart)
- art = 0;
unuse_data(1); /* free data with selections saved */
ThreadedGroup = use_data(TRUE); /* grows ctl & sets lastart */
- if (!art)
+ if (art > oldlast)
if (!forcelast)
first_art();
@@ -299,4 +309,6 @@
forcegrow = FALSE;
}
+ if (lastart > oldlast && added_articles >= 0)
+ added_articles = lastart - oldlast;
}
else
@@ -331,4 +343,16 @@
toread[ng] = (ART_UNREAD)ucount; /* this is perhaps pointless */
art = lastart + 1; /* keep bitmap references sane */
+#ifdef USETHREADS
+ if (ThreadedGroup)
+ ucount -= unthreaded;
+ if (!forcelast && selected_root_cnt && !selected_count && ucount) {
+ if (art != curr_art) {
+ art = curr_art;
+ p_art = curr_p_art;
+ }
+ strcpy(buf, "+");
+ goto article_level;
+ }
+#endif
if (art != curr_art) {
#ifdef USETHREADS
@@ -341,13 +365,4 @@
curr_art = art; /* remember this article # */
}
-#ifdef USETHREADS
- if (ThreadedGroup)
- ucount -= unthreaded;
- if (!forcelast && selected_root_cnt && !selected_count && ucount) {
- strcpy(buf, "+");
- prompt = whatnext;
- goto article_level;
- }
-#endif
if (erase_screen)
clear(); /* clear the screen */
@@ -1020,4 +1035,5 @@
art = recent_art;
reread = TRUE;
+ forcelast = TRUE;
#ifdef ARTSEARCH
srchahead = -(srchahead != 0);
Index: ngdata.c
@@ -32,4 +32,5 @@
#include "rcstuff.h"
#include "rn.h"
+#include "ng.h"
#include "intrp.h"
#include "final.h"
@@ -50,6 +51,14 @@
#ifdef SERVER
+#ifdef DEBUGGING
+ if (debug & DEB_NNTP)
+ printf(">LIST\n") FLUSH;
+#endif
put_server("LIST"); /* tell server we want the active file */
nntp_get(ser_line, sizeof(ser_line));
+#ifdef DEBUGGING
+ if (debug & DEB_NNTP)
+ printf("<%s\n", ser_line) FLUSH;
+#endif
if (*ser_line != CHAR_OK) { /* and then see if that's ok */
fprintf(stdout, "Can't get active file from server: \n%s\n", ser_line);
@@ -56,4 +65,5 @@
finalize(1);
}
+ time(&lastactfetch);
cp = filexp("%P/rrnact.%$"); /* make a temporary name */
@@ -113,4 +123,5 @@
char tmpbuf[80];
ART_POS oldsoft;
+ long last;
nam = rcline[num];
@@ -174,14 +185,15 @@
}
}
-#ifdef USETHREADS
- {
- ART_NUM last;
-
- last = atol(tmpbuf+len+1);
- return last >= ngmax[num] ? last : ngmax[num];
- }
-#else
- return atol(tmpbuf+len+1);
+ last = atol(tmpbuf+len+1);
+ if (last < ngmax[num]) {
+#ifdef SERVER
+ if (time(Null(time_t*)) - lastactfetch > MINFETCHTIME) {
+ fclose(actfp);
+ ngdata_init(); /* re-grab the active file */
+ }
#endif
+ return ngmax[num];
+ }
+ return (ART_NUM)last;
}
@@ -244,9 +256,9 @@
ART_NUM ngsize;
{
- ART_NUM a1st;
+ long a1st, last;
#ifdef CACHEFIRST
if (a1st = abs1st[ngnum])
- return a1st;
+ return (ART_NUM)a1st;
#endif
#ifdef MININACT
@@ -260,4 +272,8 @@
getngsize(ngnum); /* set moderated as side effect */
sprintf(ser_line,"GROUP %s",rcline[ngnum]);
+#ifdef DEBUGGING
+ if (debug & DEB_NNTP)
+ printf(">%s\n", ser_line) FLUSH;
+#endif
put_server(ser_line);
if (nntp_get(ser_line, sizeof(ser_line)) < 0) {
@@ -265,4 +281,8 @@
finalize(1);
}
+#ifdef DEBUGGING
+ if (debug & DEB_NNTP)
+ printf("<%s\n", ser_line) FLUSH;
+#endif
if (*ser_line == CHAR_FATAL){
fprintf(stderr,"\nrrn: %s\n",ser_line);
@@ -269,12 +289,14 @@
finalize(1);
}
- if (*ser_line != CHAR_OK) { /* and then see if that's ok */
+ if (*ser_line != CHAR_OK) /* and then see if that's ok */
a1st = ngsize+1; /* nothing there */
+ else {
+ (void) sscanf(ser_line,"%*d%*d%ld%ld",&a1st,&last);
+ ngmax[ngnum] = last;
}
- (void) sscanf(ser_line,"%*d%*d%d",&a1st);
# ifdef CACHEFIRST
- abs1st[ngnum] = a1st;
+ abs1st[ngnum] = (ART_NUM)a1st;
# endif
- return a1st;
+ return (ART_NUM)a1st;
#endif
}
Index: ngdata.h
@@ -27,4 +27,6 @@
#ifdef SERVER
EXT char active_name[MAXFILENAME];
+ EXT time_t lastactfetch INIT(0);
+#define MINFETCHTIME (5 * 60)
#endif
Index: rcln.c
@@ -349,7 +349,5 @@
ART_NUM newmax;
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax[ngnum] = ngsize; /* for checking out-of-range Xrefs */
-#endif
if (ngsize == TR_BOGUS) {
printf("\nWarning! Bogus newsgroup: %s\n",rcline[ngnum]) FLUSH;
@@ -385,6 +383,11 @@
unread--; /* recalculate length */
if (newmax > ngsize) { /* paranoia check */
- unread = -1;
- break;
+ if (newmax > ngsize + 100) {
+ unread = -1;
+ break;
+ } else {
+ unread += newmax - ngsize;
+ ngmax[ngnum] = ngsize = newmax;
+ }
}
}
Index: rcln.h
@@ -21,7 +21,5 @@
*/
-#if defined(DEBUGGING) || defined(USETHREADS)
EXT ART_NUM *ngmax INIT(NULL);
-#endif
void rcln_init ANSI((void));
Index: rcstuff.c
@@ -351,6 +351,4 @@
#define ADDNEW_UNSUB '!'
-static int addnewbydefault = 0;
-
bool
get_ng(what,do_reloc)
@@ -582,7 +580,5 @@
ACT_POS tmpsoftptr;
register NG_NUM i;
-#if defined(DEBUGGING) || defined(USETHREADS)
ART_NUM tmpngmax;
-#endif
#ifdef CACHEFIRST
ART_NUM tmpabs1st;
@@ -605,7 +601,5 @@
tmprcnums = rcnums[ngx];
tmpsoftptr = softptr[ngx];
-#if defined(DEBUGGING) || defined(USETHREADS)
tmpngmax = ngmax[ngx];
-#endif
#ifdef CACHEFIRST
tmpabs1st = abs1st[ngx];
@@ -617,7 +611,5 @@
rcnums[i-1] = rcnums[i];
softptr[i-1] = softptr[i];
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax[i-1] = ngmax[i];
-#endif
#ifdef CACHEFIRST
abs1st[i-1] = abs1st[i];
@@ -629,7 +621,5 @@
rcnums[nextrcline-1] = tmprcnums;
softptr[nextrcline-1] = tmpsoftptr;
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax[nextrcline-1] = tmpngmax;
-#endif
#ifdef CACHEFIRST
abs1st[nextrcline-1] = tmpabs1st;
@@ -751,7 +741,5 @@
tmprcnums = rcnums[nextrcline-1];
tmpsoftptr = softptr[nextrcline-1];
-#if defined(DEBUGGING) || defined(USETHREADS)
tmpngmax = ngmax[nextrcline-1];
-#endif
#ifdef CACHEFIRST
tmpabs1st = abs1st[nextrcline-1];
@@ -763,7 +751,5 @@
rcnums[i+1] = rcnums[i];
softptr[i+1] = softptr[i];
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax[i+1] = ngmax[i];
-#endif
#ifdef CACHEFIRST
abs1st[i+1] = abs1st[i];
@@ -775,7 +761,5 @@
rcnums[newng] = tmprcnums;
softptr[newng] = tmpsoftptr;
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax[newng] = tmpngmax;
-#endif
#ifdef CACHEFIRST
abs1st[newng] = tmpabs1st;
@@ -1154,7 +1138,5 @@
int newsize;
{
-#if defined(CACHEFIRST) || defined(USETHREADS)
register int i;
-#endif
#ifdef CACHEFIRST
@@ -1161,7 +1143,5 @@
abs1st = (ART_NUM *) grow((char*)abs1st, newsize, sizeof(ART_NUM));
#endif
-#if defined(DEBUGGING) || defined(USETHREADS)
ngmax = (ART_NUM *) grow((char*)ngmax, newsize, sizeof(ART_NUM));
-#endif
rcline = (char **) grow((char*)rcline, newsize, sizeof(char*));
toread = (ART_UNREAD *) grow((char*)toread, newsize, sizeof(ART_UNREAD));
@@ -1170,14 +1150,10 @@
softptr = (ACT_POS *) grow((char*)softptr, newsize, sizeof(ACT_POS));
-#if defined(CACHEFIRST) || defined(USETHREADS)
for (i=maxrcline; i < newsize; i++) {
-# ifdef CACHEFIRST
+#ifdef CACHEFIRST
abs1st[i] = 0;
-# endif
-# ifdef USETHREADS
+#endif
ngmax[i] = 0;
-# endif
}
-#endif /* CACHEFIRST || USETHREADS */
maxrcline = newsize;
return;
Index: rcstuff.h
@@ -45,4 +45,5 @@
EXT bool paranoid INIT(FALSE); /* did we detect some inconsistency in .newsrc? */
EXT int maxrcline INIT(0); /* current maximum # of lines in .newsrc */
+EXT int addnewbydefault INIT(0);
bool rcstuff_init ANSI((void));
Index: rn.c
@@ -1,8 +1,10 @@
-/* rn -- new readnews program
+/* trn -- threaded readnews program
*
+ * Author/Maintainer of trn: davison@borland.com (Wayne Davison)
+ * Organization: Borland International
+ * Author/Maintainer of rn: sob@bcm.tmc.edu (Stan Barber)
+ * Organization: Baylor College of Medicine, Houston,Tx
* Original Author: lwall@sdcrdcf.UUCP (Larry Wall)
* Organization: System Development Corporation, Santa Monica
- * Current Author/Maintainer: sob@bcm.tmc.edu (Stan Barber)
- * Organization: Baylor College of Medicine, Houston,Tx
*
* begun: 01/14/83
@@ -26,5 +28,5 @@
static char rnid[] = "@(#)$Id: rn.c,v 4.4.3.1 1991/11/22 04:12:14 davison Trn $";
-static char patchlevel[] = "Trn 2.1 based on rn 4.4 pl 2";
+static char patchlevel[] = "Trn 2.2 based on rn 4.4 pl 2";
/* $Log: rn.c,v $
@@ -205,4 +207,10 @@
unflush_output(); /* disable any ^O in effect */
if (ng >= nextrcline) {
+#ifdef SERVER
+ if (time(Null(time_t*)) - lastactfetch > MINFETCHTIME) {
+ fclose(actfp);
+ ngdata_init(); /* re-grab the active file */
+ }
+#endif
dfltcmd = (retry ? "npq" : "qnp");
#ifdef VERBOSE
@@ -508,4 +516,5 @@
goto reask_newsgroup;
#else
+ addnewbydefault = 0;
/* FALL THROUGH */
#endif
Index: rt-select.c
@@ -74,4 +74,7 @@
empty_ok = FALSE;
+ if (added_articles > 0)
+ select_page = 0;
+
select_threads:
/* Setup for selecting articles to read or set unread */
@@ -306,5 +309,18 @@
}
#endif
- displayed_status = FALSE;
+ if (added_articles > 0) {
+ printf("\n** %d article%s been added **", added_articles,
+ added_articles == 1 ? " has" : "s have");
+ displayed_status = TRUE;
+ if (can_home) {
+ carriage_return();
+ goto_line(screen_line+1, screen_line);
+ } else {
+ putchar('\n');
+ }
+ } else {
+ displayed_status = FALSE;
+ }
+ added_articles = 0;
prompt_select:
standout();
Index: rthreads.c
@@ -242,6 +242,8 @@
if (total.last > lastart) {
#ifdef SERVER
- fclose(actfp);
- ngdata_init(); /* re-grab the active file */
+ if (time(Null(time_t*)) - lastactfetch > MINFETCHTIME) {
+ fclose(actfp);
+ ngdata_init(); /* re-grab the active file */
+ }
#endif
grow_ctl(total.last); /* sets lastart */
Index: rthreads.h
@@ -27,4 +27,5 @@
EXT int selected_root_cnt INIT(0);
EXT ART_NUM selected_count INIT(0);
+EXT int added_articles INIT(0);
EXT int unthreaded INIT(0);
EXT int select_page;
Index: term.c
@@ -1188,5 +1188,6 @@
#ifdef SIGWINCH
SIGRET
-winch_catcher()
+winch_catcher(dummy)
+int dummy;
{
/* Reset signal in case of System V dain bramage */
Index: term.h
@@ -277,4 +277,4 @@
#endif
#ifdef SIGWINCH
-SIGRET winch_catcher ANSI((void));
+SIGRET winch_catcher ANSI((int));
#endif /* SIGWINCH */
Index: util.c
@@ -536,14 +536,18 @@
#ifdef TZSET
extern char *tzname[];
+#else
+# ifndef TM_ZONE
+char tznm[16] = "";
+# endif
#endif
-int
+size_t
strftime(str, maxsize, fmt, ts)
char *str;
-int maxsize;
+size_t maxsize;
char *fmt;
struct tm *ts;
{
- int num = 0, len;
+ size_t num = 0, len;
char ch;
char *putstr, *s;
@@ -679,5 +683,17 @@
sprintf(tmpbuf, "%s", tzname[ts->tm_isdst]);
#else
+# ifdef TM_ZONE
sprintf(tmpbuf, "%s", ts->tm_zone);
+# else
+ if (*tznm == '\0') {
+ char *timezone();
+ struct timeval tv;
+ struct timezone tz;
+
+ (void) gettimeofday(&tv, &tz);
+ strcpy(tznm, timezone(tz.tz_minuteswest, ts->tm_isdst));
+ }
+ sprintf(tmpbuf, "%s", tznm);
+# endif
#endif
break;
Index: util.h
@@ -56,2 +56,8 @@
int nntp_get ANSI((char *, int));
#endif
+#ifndef FOUNDSIZET
+#define size_t int
+#endif
+#ifndef STRFTIME
+size_t strftime ANSI((char *, size_t, char *, struct tm *));
+#endif
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Technical Details
Message-ID:
<1991Dec10.052920.11789@borland.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <1991Dec10.052920.11789@borland.com> Subject: Trn 2 patch #2 Date: Tue, 10 Dec 1991 05:29:20 GMT From: davison@borland.com (Wayne Davison) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail Newsgroups: news.software.readers,comp.sources.d,comp.sources.bugs