🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #66263

Re: innreport error

#66263
From: Steve
Date: Mon, 21 Jul 2003 13:20
102 lines
4132 bytes
Steve wrote:

> Steve wrote:
> 
>> Russ Allbery wrote:
>> 
>>> Steve <steve@nospam-goofer.co.uk> writes:
>>> 
>>>> I guess the problem here is with the line feed after the "{"
>>>> causing $1 to be empty? 
>>> 
>>> No, that regex shouldn't care about the line feed.  You should be
>>> able to add a \n to the end of the string in the script I gave you
>>> and it should still work.
>>> 
>> 
>> Russ,
>> 
>> You're right, I tried it and the expression still works in your test 
>> script.  Looks like I'm back to square one.  :)
>> 
>> I've been trying various things, and currently I have this section 
>> within innreport:
>> 
>> print "Before-->$line<-->$linenum<--\n\n";
>>   $line =~ s/^(                  # at the beginning
>>                [{};]             # match '{', '}', or ';'
>>               |                  # OR
>>                \"                # a double quoted string
>>                 (?:\\.|[^\"\\])*
>>                \"
>>               |                  # OR
>>                [^{};\"\s]+       # a word
>>              )\s*//mox;
>> print "After-->$line<-->$linenum<--\n\n";
>> 
>> The output from this is:
>> 
>> Before-->section default {
>> <-->12<--
>> 
>> After-->section default {
>> <-->12<--
>> 
>> So it seems that the Regular Expression is not doing its thing.  I've
>> even deleted the RegEx and pasted in the one from your test script,
>> but the results remain unchanged.
>> 
> 
> Scrap that, the regex is working.
> If I hardcode $line="section default {" right before the regex, then
> it works perfectly.  Something about the line being read from the conf
> file breaks it, even though it looks absolutely correct. 

sub read_conf {
  my ($linenum, $line, $file) = @_;
  *FILE = *$file;

  $line =~ s,^\s+,,o;            # remove useless blanks
  $line =~ s,^(\#|//).*$,,o;     # remove comments (at the beginning)
  while (($line =~ m/^$/o || $line =~ m/^\"[^\"]*$/o) && !(eof (FILE))) 
{
    $line .= <FILE>;             # read one line
    $linenum++;
    $line =~ s,^\s*,,om;         # remove useless blanks
    $line =~ s,^(\#|//).*$,,om;  # remove comments (at the beginning)
  }
my @codes = map {sprintf "%2X", ord $_ } (split //, $line);
print "@codes\n";
$line = "section default {\n";
@codes = map {sprintf "%2X", ord $_ } (split //, $line);
print "@codes\n\n\n";

Included these lines to check the ASCII codes within $line, before and 
after hard coding it.

Output is:

73 65 63 74 69 6F 6E 20 64 65 66 61 75 6C 74 20 7B  A
73 65 63 74 69 6F 6E 20 64 65 66 61 75 6C 74 20 7B  A

This indicates that the "section default {" line read from 
innreport.conf is abolutely identical to:
$line = "section default {" hardcoded.

Amazingly, it still works if I hardcode it, but not with the line from 
innreport.conf.  Insanity is gaining a firm footing here now!














Technical Details
Message-ID: <bfgpbl$65t$1@bananasplit.info>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.stueberl.de!feed.news.nacamar.de!newsfeed.icl.net!newsfeed.fjserv.net!news.itconsult.net!news.dizum.com!sewer-output!mail2news
References: <bf3jb2$j5s$1@bananasplit.info> <87isq1hrmf.fsf@windlord.stanford.edu> <bf6v64$95r$1@bananasplit.info> <87he5khpyv.fsf@windlord.stanford.edu> <bf72uk$s4h$1@puck.litech.org> <bf7516$ani$1@bananasplit.info> <bfej7c$ikc$1@bananasplit.info> <87adb93x5f.fsf@windlord.stanford.edu> <bfgmba$5g1$1@bananasplit.info> <bfgn0m$5g1$2@bananasplit.info>

Show Full Headers
Complete Article Headers
Message-ID: <bfgpbl$65t$1@bananasplit.info>
Subject: Re: innreport error
Date: Mon, 21 Jul 2003 13:20:53 +0000
From: Steve <steve@nospam-goofer.co.uk>
References: <bf3jb2$j5s$1@bananasplit.info> <87isq1hrmf.fsf@windlord.stanford.edu> <bf6v64$95r$1@bananasplit.info> <87he5khpyv.fsf@windlord.stanford.edu> <bf72uk$s4h$1@puck.litech.org> <bf7516$ani$1@bananasplit.info> <bfej7c$ikc$1@bananasplit.info> <87adb93x5f.fsf@windlord.stanford.edu> <bfgmba$5g1$1@bananasplit.info> <bfgn0m$5g1$2@bananasplit.info>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.stueberl.de!feed.news.nacamar.de!newsfeed.icl.net!newsfeed.fjserv.net!news.itconsult.net!news.dizum.com!sewer-output!mail2news
Newsgroups: news.software.nntp
Organization: Bananasplit
Lines: 87
X-Complaints-To: abuse@bananasplit.info
User-Agent: Xnews/06.02.16
Mail-To-News-Contact: abuse@dizum.com