Article View: news.software.nntp
Article #66253Re: innreport error
From: Steve
Date: Sun, 20 Jul 2003 17:23
Date: Sun, 20 Jul 2003 17:23
96 lines
3085 bytes
3085 bytes
Steve wrote:
> Jeffrey M. Vinocur wrote:
>
>> In article <87he5khpyv.fsf@windlord.stanford.edu>,
>> Russ Allbery <rra@stanford.edu> wrote:
>>>
>>>Okay, so that Perl code actually works. That makes me think that
>>>something else strange is going on.
>>
>> Yeah :-/
>>
>> Steve, when you checked the value of $line before and after the
>> regex, how paranoid were you? (In particular, can you do
>> something like this: print "->$line<- ", length $line; and make
>> sure there aren't any hidden characters that could somehow break
>> things.)
>>
>>
>
> Thanks for all your efforts on helping me here, really is
> appreciated.
>:)
>
> I've made the code as follows:
>
> $line =~ s/^( # at the beginning
> [{};] # match '{', '}', or ';'
> | # OR
> \" # a double quoted string
> (?:\\.|[^\"\\])*
> \"
> | # OR
> [^{};\"\s]+ # a word
> )\s*//mox;
> print "->$line<- ", length $line, "\n";
> my $info = $1;
> print "->$info<- ", length $info, "\n";
> if (defined $info && $info) {
> chomp $info;
> }
>
>
> When run, I get the following:
>
> ->section default {
> <- 18
> ->#<- 1
> Error in ../etc/innreport.conf line 12: must be 'section' instead of
> '#'
I guess the problem here is with the line feed after the "{" causing $1
to be empty?
I've tried inserting "print" statements right at the top of the
subroutine, and $line seems to have the LF from the moment it's read.
The same applies to all the comment fields read prior to the "section"
line. I've edited innreport.conf and there's nothing in it I can
identify that would cause this behaviour.
The perl script Russ sent me as a test works fine as $line is defined
as "section default {" and no LF is appended to it.
Technical Details
Message-ID:
<bfej7c$ikc$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!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!kibo.news.demon.net!demon!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!news.itconsult.net!news.dizum.com!sewer-output!mail2newsReferences:
<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>Show Full Headers
Complete Article Headers
Message-ID: <bfej7c$ikc$1@bananasplit.info> Subject: Re: innreport error Date: Sun, 20 Jul 2003 17:23:56 +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> 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!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!kibo.news.demon.net!demon!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!news.itconsult.net!news.dizum.com!sewer-output!mail2news Newsgroups: news.software.nntp Organization: Bananasplit Lines: 62 X-Complaints-To: abuse@bananasplit.info User-Agent: Xnews/06.02.16 Mail-To-News-Contact: abuse@dizum.com