🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Olaf Titz Sat, 21 Oct 1995 00:00
"Include" capability for kill files [trn]
#17378
Author: 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 << ____
Thread Navigation

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

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

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

Back to All Threads