Perlfect Solutions

Rejected: "[Perlfect-search] FIX: save title correctly"
Fri, 26 Oct 2001 01:15:27 GMT
Inews returned Operation not permitted for this message even after escaping quoted

Message has not been posted to discussion group.

Received: from localhost (root@localhost []) by (8.9.1/8.9.1) with ESMTP id BAA19015 for
    <markMLl.perlfect-search@localhost>; Fri, 26 Oct 2001 01:01:37 GMT
X-Received+1: from wingate by fetchmail-4.6.3 POP3 for
    <markMLl.perlfect-search/localhost> (single-drop); Fri, 26 Oct 2001
    01:01:37 GMT
X-Received+2: from[] by for; Thu,
    25 Oct 2001 19:21:25 +0100
X-Received+3: from ( []) by
    (8.9.2/8.9.2) with ESMTP id OAA31456; Thu, 25 Oct 2001 14:15:15 -0400 (EDT)
X-Received+4: from ( []) by (8.9.2/8.9.2) with ESMTP id OAA31405 for
    <>; Thu, 25 Oct 2001 14:14:19 -0400 (EDT)
X-Received+5: from ( []) by (8.9.3/8.9.3) with ESMTP id NAA30349 for
    <>; Thu, 25 Oct 2001 13:14:14 -0500
X-Received+6: by (Postfix, from userid 501) id 82626177BE;
    Thu, 25 Oct 2001 13:14:14 -0500 (CDT)
Date: Thu, 25 Oct 2001 13:14:14 -0500
From: postmaster
Message-ID: <>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Subject: [Perlfect-search] FIX: save title correctly
Precedence: bulk
List-Id: Perlfect Search mailing list <>
Newsgroups: mailing-lists.perlfect
X-From: Cameron Moore <>

Fixed another bug.  :-p

In, I was jacking around with index_file() and added some
code containing:

  $url =~ /.+\.(.*)$/;

Well, that ended up breaking the title saving code in record_desc().
The offending code starts at line 375 in CVS and looks like:

  ${$buffer} =~ m/<TITLE>(.*?)<\/TITLE>/is;
  $title = $1;

The problem lies in setting $title = $1 without checking to see where it
came from.  If the TITLE pattern doesn't match, $1 is left alone...which
means it will remain whatever it was prior to it the current pattern.
In this case, $1 = 'pdf'.  When the TITLE pattern doesn't catch
anything, $title is set to 'pdf'!  Yikes!  This doesn't effect most HTML
files because they almost always have a title specified, but it will
break for any HTML files that don't.  The fix is to do this:

  ($title) = ${$buffer} =~ m/<TITLE>(.*?)<\/TITLE>/is;

$1 is used in a few other places that I don't think are affected by this
problem, but the above fix should take care of this issue.

BTW, is there anonymous pserver CVS access?  I couldn't find any mention
of it.  Thanks
Cameron Moore
/ I think you can be an honest person and lie about any number \
\    of things.  -- Dan Rather talking about President Clinton /
perlfect-search mailing list
To unsubscribe, set other personal options or view the list archives please visit: