🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #17378

"Include" capability for kill files [trn]

#17378
From: Olaf Titz
Date: Sat, 21 Oct 1995 00:00
45 lines
2042 bytes
Nice feature I'd thought of yesterday: Provide an include command for
kill files. Useful if you have a list of kill file commands you want
to apply to a set of newsgroups.

The following nearly trivial patch implements this for trn 3.6.
A line of the form
INC filename
in a kill file will read the commands from that file. The file name is
subject to % and ~ interpolation. Any number of includes and recursion
is possible (loops are broken by the system's limit on open files :-)

Surely this can be improved but for now it seems to work.

Enjoy,

Olaf

--- kfile.c.orig	Tue Aug  1 17:26:44 1995
+++ kfile.c	Sat Oct 21 21:46:59 1995
@@ -106,6 +106,20 @@
 		killfirst = lastart+1;
 	    continue;
 	}
+	if (strnEQ(buf,"INC",3)) {
+	    FILE *incfile;
+	    int r;
+	    cp = buf+3;
+	    while ((*cp) && isspace(*cp))
+	        ++cp;
+	    if ((*cp) && (cp=filexp(cp)) && (incfile=fopen(cp, "r"))) {
+	        r = do_kfile(incfile, entering);
+		fclose(incfile);
+	        if (r)
+		    return r;
+	    }
+	    continue;
+	}
 	if (*buf == 'X') {		/* exit command? */
 	    if (entering) {
 		exitcmds = TRUE;
-- 
___        Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de       ____
__ o           <URL:http://www.inka.de/~bigred/>     <IRC:praetorius>
__/<_              >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____
Technical Details
Message-ID: <KJY5B25C@bigred.inka.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.sources.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <KJY5B25C@bigred.inka.de>
Subject: "Include" capability for kill files [trn]
Date: Sat, 21 Oct 1995 00:00:00 +0000
From: Olaf Titz <olaf@bigred.inka.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.sources.mbox.zip!not-for-mail
X-Deja-AN: 117881224
Organization: private Linux site, southern Germany
Followup-to: news.software.readers,alt.sources.d
Newsgroups: news.software.readers,alt.sources