🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #34317

Re: Question on scoring in slrn!

#34317
From: John E. Davis
Date: Wed, 18 Jun 1997 00:00
49 lines
1494 bytes
On 16 Jun 1997 05:14:57 GMT, Pardoz <pardoz@io.com>
wrote:
>     The buglet's still there in 0.9.4.0.

In slrn/src/util.c, replace the function `slrn_fix_regexp' with this:

char *slrn_fix_regexp (char *pat)
{
   static char newpat[256];
   char *p, ch;
   unsigned int len;

   len = 1;			       /* For ^ */
   p = pat;
   while (*p != 0)
     {
	if ((*p == '.') || (*p == '*')) len++;
	len++;
	p++;
     }
   len++;			       /* for $ */
   len++;			       /* for \0 */

   if (len > sizeof(newpat))
     slrn_exit_error ("Pattern too long for buffer");
     
   p = newpat;

   *p++ = '^';
   while ((ch = *pat++) != 0)
     {
	if (ch == '.')
	  *p++ = '\\';
	else if (ch == '*')
	  *p++ = '.';

	*p++ = ch;
     }
   
   if (*(p - 1) != '$') 
     *p++ = '$';

   *p = 0;

   return newpat;
}

Technical Details
Message-ID: <slrn5qevn1.52.davis@mygir.davis.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn5q58ap.tae.evenh@bigblue.pvv.ntnu.no> <slrn5q6s8f.au4.jbn@pop-a-wheelie.midwest.net> <slrn5q8f50.5l.pardoz@io.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn5qevn1.52.davis@mygir.davis.net>
Subject: Re: Question on scoring in slrn!
Date: Wed, 18 Jun 1997 00:00:00 +0000
From: davis@space.mit.edu (John E. Davis)
References: <slrn5q58ap.tae.evenh@bigblue.pvv.ntnu.no> <slrn5q6s8f.au4.jbn@pop-a-wheelie.midwest.net> <slrn5q8f50.5l.pardoz@io.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 249286677
Organization: Center for Space Research
Newsgroups: news.software.readers