Article View: news.software.readers
Article #16133Re: TRN macros
From: Wayne Davison
Date: Fri, 17 Mar 1995 20:57
Date: Fri, 17 Mar 1995 20:57
60 lines
2605 bytes
2605 bytes
According to Olly Betts <olly@mantis.co.uk>:
> I assume the X-ORIGINAL-NEWSGROUPS is a "your follow-up is being redirected
> somewhere" warning.
Yup, that's it's purpose.
> However, it only catches an empty or non-existant Followup-To:. There are a
> number of posts around which have a Followup-To: with the same groups as the
> Newsgroups: line.
You need trn 3.6 for your macro to work (which has an identical macro for
the default for the X-ORIGINAL-NEWSGROUPS as the one you suggested). The
problem is, as you surmised, the comparison:
%(%[followup-to]=^%n$?
will never succeed in older s/t/rn's because the regex portion of the '='
comparison would never expand '%'s -- it is comparing to the literal string
"%n". Trn 3.6 enhanced the equality operator to allow this to work.
Since you are using strn, you'll either have to manually apply a patch
or wait for the trn fixes to arrive in strn form. I'm working on a
unification of strn and trn's latest enhancements that will arrive at
some point as trn 4.0, but that won't be for a while yet.
I believe the relevant change from trn 3.6 to fix this problem is
this hunk of code, which abuses a few local variables in the process
but gets the job done:
Index:intrp.c
@@ -568,4 +574,26 @@
if (!*pattern)
goto getout;
+ s = scrbuf;
+ h = spfbuf;
+ proc_sprintf = FALSE;
+ do {
+ switch (*s) {
+ case '^':
+ *h++ = '\\';
+ break;
+ case '\\':
+ *h++ = '\\';
+ *h++ = '\\';
+ break;
+ case '%':
+ proc_sprintf = TRUE;
+ break;
+ }
+ *h++ = *s;
+ } while (*s++);
+ if (proc_sprintf) {
+ dointerp(scrbuf,sizeof scrbuf,spfbuf,Nullch);
+ proc_sprintf = FALSE;
+ }
if (s = compile(&cond_compex,scrbuf,TRUE,TRUE)) {
printf("%s: %s\n",scrbuf,s) FLUSH;
--
Wayne Davison
wayne@trn.com
Technical Details
Message-ID:
<3kct34$qsq@nic.scruz.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!cs.utexas.edu!uwm.edu!lll-winken.llnl.gov!overload.lbl.gov!emf.emf.net!hilbert.dnai.com!nic.scruz.net!not-for-mailReferences:
<"Mon_Mar_13_17:14:17_GMT_1995".olly@mantis.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <3kct34$qsq@nic.scruz.net> Subject: Re: TRN macros Date: Fri, 17 Mar 1995 20:57:07 +0000 From: davison@trn.com (Wayne Davison) References: <"Mon_Mar_13_17:14:17_GMT_1995".olly@mantis.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!cs.utexas.edu!uwm.edu!lll-winken.llnl.gov!overload.lbl.gov!emf.emf.net!hilbert.dnai.com!nic.scruz.net!not-for-mail Newsgroups: news.software.readers Organization: Lack thereof Lines: 60 NNTP-Posting-Host: 192.122.209.42