Article View: news.software.nntp
Article #25Re: Can 'rrn' check for new news?
From: Lloyd Zusman
Date: Mon, 16 May 1988 01:16
Date: Mon, 16 May 1988 01:16
112 lines
4207 bytes
4207 bytes
In article <3417@pasteur.Berkeley.Edu> phil@east.Berkeley.EDU (Phil Lapsley) writes:
>rrn can't check for new news as distributed. On startup it snarfs
>the active file from the server and makes a local copy. Since the
>local copy doesn't change, rrn doesn't think there is new news.
> ...
Well, since that's the way it is, I decided to fix it.
Here is a patch to 'rrn'. It works with the latest version of 'rrn'
that I have been able to locate. It took me about an hour to do, but
it works just fine for me. My apologies in advance if it is overly
simple and overlooks something important that might break 'rrn' under
some conditions.
It adds a new command line-option "-A" (for "check news *A*gain")
which, if set, causes 'rrn' to check for new news once it has gone
through all the newsgroups. When this option is set, 'rrn' will never
set the default reply to "q" at the "End of newsgroups--what next?"
prompt, thereby allowing this check to be repeated over and over until
"q" is explicitly typed.
Enjoy.
--
Lloyd Zusman
Master Byte Software
Los Gatos, California Internet: ljz@fx.com
"We take things well in hand." UUCP: ...!ames!fxgrp!ljz
--------------------------- Patch begins here ----------------------------
*** Configure Sun May 15 17:23:27 1988
--- Configure.new Sun May 15 17:54:25 1988
***************
*** 2074,2079 ****
--- 2074,2081 ----
#$isrrn SERVER /* rrn server code */
#$isrrn SERVER_HOST "$rrnserver"
#$isrrn SERVER_FILE "$serverfile"
+
+ #define CHECK_ON_EXIT /* check for new news before exit if -A option */
EOT
CONFIG=true
*** common.h Sun May 15 17:00:33 1988
--- common.h.new Sun May 15 17:54:38 1988
***************
*** 726,731 ****
--- 726,735 ----
EXT int scanon INIT(0); /* -S */
#endif
+ #ifdef CHECK_ON_EXIT
+ EXT bool check_again_before_exit INIT(FALSE); /* -A */
+ #endif /* CHECK_ON_EXIT */
+
EXT bool mbox_always INIT(FALSE); /* -M */
EXT bool norm_always INIT(FALSE); /* -N */
EXT bool checkflag INIT(FALSE); /* -c */
*** config.h Sun May 15 17:32:53 1988
--- config.h.new Sun May 15 17:55:31 1988
***************
*** 81,83 ****
--- 81,84 ----
#define SERVER /* rrn server code */
#define SERVER_HOST ""
#define SERVER_FILE "/usr/new/lib/rn/nntp_server"
+ #define CHECK_ON_EXIT /* check for new news before exit if -A option */
*** rn.c Sun May 15 16:39:40 1988
--- rn.c.new Sun May 15 17:55:41 1988
***************
*** 111,116 ****
--- 111,131 ----
mode = 'n';
if (ng >= nextrcline) { /* after the last newsgroup? */
ng = nextrcline; /* force it to 1 after */
+ #ifdef CHECK_ON_EXIT
+ if (check_again_before_exit) {
+ /*
+ * See if any new news has arrived before giving
+ * the caller a chance to exit.
+ */
+ ngdata_init();
+ foundany = rcstuff_init();
+ if (foundany) {
+ ng = starthere = 0;
+ continue;
+ }
+ }
+ #endif /* CHECK_ON_EXIT */
+
#ifdef ONLY
if (maxngtodo) {
if (retry)
***************
*** 139,144 ****
--- 154,167 ----
}
}
#endif
+ #ifdef CHECK_ON_EXIT
+ /*
+ * Never default to 'q' when -A is selected.
+ */
+ if (check_again_before_exit)
+ dfltcmd = "npq";
+ else
+ #endif /* CHECK_ON_EXIT */
dfltcmd = (retry ? "npq" : "qnp");
#ifdef VERBOSE
IF(verbose)
Technical Details
Message-ID:
<322@fxgrp.UUCP>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!think!ames!fxgrp!ljzReferences:
<298@fxgrp.UUCP> <3417@pasteur.Berkeley.Edu>Show Full Headers
Complete Article Headers
Message-ID: <322@fxgrp.UUCP> Subject: Re: Can 'rrn' check for new news? Date: Mon, 16 May 1988 01:16:10 +0000 From: ljz@fxgrp.fx.com (Lloyd Zusman) References: <298@fxgrp.UUCP> <3417@pasteur.Berkeley.Edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!think!ames!fxgrp!ljz Newsgroups: news.software.nntp Sender: news@fxgrp.UUCP Reply-To: ljz@fx.com (Lloyd Zusman) Organization: Master Byte Software, Los Gatos, California Lines: 111