Article View: news.software.readers
Article #73740Bug in slang regexp routine (was: Xnews score file too big for slrn?)
From: Thomas Schultz
Date: Sat, 17 Mar 2001 14:48
Date: Sat, 17 Mar 2001 14:48
59 lines
3011 bytes
3011 bytes
* J.B. Nicholson-Owens [2001-03-17 06:11] :
> Thomas Schultz wrote:
>> Curly braces do not have a special meaning in slang regular expressions.
> I got that from the 'rgrep -?' info, I believe they're meant to
> repeat the previous character a certain number of times [...]
You are right, curly braces are supposed to work in slang regular
expressions. It's just not covered by the documentation in slang.txt
and (at least in slang 1.4.4) does not work when doing case
independant matches (which is the default in slrn scorefile entries).
Luckily, the latter problem proved to be easy to fix. I hope this
goes into the next version of slang (CC goes to JED):
#v+
--- slregexp.c.orig Sat Mar 17 15:25:21 2001
+++ slregexp.c Sat Mar 17 15:29:35 2001
@@ -158,7 +158,7 @@
n1 = (int) (unsigned char) *buf++;
/* maximum number to match */
- while (n && (str < estr) && (p1 != *str))
+ while (n && (str < estr) && (p1 != UPPERCASE(*str)))
{
n--;
str++;
@@ -167,7 +167,7 @@
save_str = str;
n = n1 - n0;
- while (n && (str < estr) && (p1 != *str))
+ while (n && (str < estr) && (p1 != UPPERCASE(*str)))
{
n--;
str++;
@@ -204,7 +204,7 @@
n1 = (int) (unsigned char) *buf++;
/* maximum number to match */
- while (n && (str < estr) && (p1 == *str))
+ while (n && (str < estr) && (p1 == UPPERCASE(*str)))
{
n--;
str++;
@@ -213,7 +213,7 @@
save_str = str;
n = n1 - n0;
- while (n && (str < estr) && (p1 == *str))
+ while (n && (str < estr) && (p1 == UPPERCASE(*str)))
{
n--;
str++;
#v-
--
Thomas Schultz <tststs@gmx.de> * Recent news from http://slrn.sourceforge.net/
-> [2001-03-15] Public preview of slrn 0.9.7.0
-> [2001-01-28] First steps towards slrn 0.9.7.0
-> [2001-01-19] Thomas Schultz new slrn maintainer
Technical Details
Message-ID:
<slrn9b6u9n.9kn.tststs@starflower.tststs.ddns.org>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!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.esat.net!do.de.uu.net!innmaster.de.uu.net!news.cityweb.de!tststs.ddns.org!not-for-mailReferences:
<Xns9065E9498E43iamthearm@207.126.101.100> <slrn9b12da.1be.jbn@forestfield.org> <slrn9b4nha.21r.tststs@starflower.tststs.ddns.org> <slrn9b5vtc.4s2.jbn@forestfield.org>Show Full Headers
Complete Article Headers
Message-ID: <slrn9b6u9n.9kn.tststs@starflower.tststs.ddns.org> Subject: Bug in slang regexp routine (was: Xnews score file too big for slrn?) Date: Sat, 17 Mar 2001 14:48:23 +0000 From: tststs@gmx.de (Thomas Schultz) References: <Xns9065E9498E43iamthearm@207.126.101.100> <slrn9b12da.1be.jbn@forestfield.org> <slrn9b4nha.21r.tststs@starflower.tststs.ddns.org> <slrn9b5vtc.4s2.jbn@forestfield.org> 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!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.esat.net!do.de.uu.net!innmaster.de.uu.net!news.cityweb.de!tststs.ddns.org!not-for-mail Newsgroups: news.software.readers Organization: Pinguin online. Lines: 58 NNTP-Posting-Host: 149.225.49.243 NNTP-Posting-Date: 17 Mar 2001 16:05:31 GMT X-Complaints-To: abuse@cityweb.de X-Server-Date: 17 Mar 2001 16:03:07 GMT User-Agent: slrn/0.9.6.4pl4a (Linux)