Perlfect Solutions
 

Rejected: "[Perlfect-search] FIX: save title correctly"

Imprimatur@telemetry.co.uk Imprimatur@telemetry.co.uk
Fri, 26 Oct 2001 01:15:27 GMT
Inews returned Operation not permitted for this message even after escaping quoted
content.

Message has not been posted to discussion group.

----------------
Received: from localhost (root@localhost [127.0.0.1]) by
    pye-srv-02.telemetry.co.uk (8.9.1/8.9.1) with ESMTP id BAA19015 for
    <markMLl.perlfect-search@localhost>; Fri, 26 Oct 2001 01:01:37 GMT
Envelope-To: markMLl.perlfect-search@telemetry.co.uk
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 jacuzzi.perlfect.com([198.94.138.184] HELO:perlfect.com) by
    clueless.redbus.aaisp.net for markMLl.perlfect-search@telemetry.co.uk; Thu,
    25 Oct 2001 19:21:25 +0100
X-Received+3: from perlfect.com ( [127.0.0.1]) by perlfect.com
    (8.9.2/8.9.2) with ESMTP id OAA31456; Thu, 25 Oct 2001 14:15:15 -0400 (EDT)
X-Received+4: from robin.bitstreet.net (robin.bitstreet.net [206.142.133.6]) by
    perlfect.com (8.9.2/8.9.2) with ESMTP id OAA31405 for
    <perlfect-search@perlfect.com>; Thu, 25 Oct 2001 14:14:19 -0400 (EDT)
X-Received+5: from toad.bitstreet.net (toad.bitstreet.net [206.142.128.252]) by
    robin.bitstreet.net (8.9.3/8.9.3) with ESMTP id NAA30349 for
    <perlfect-search@perlfect.com>; Thu, 25 Oct 2001 13:14:14 -0500
X-Received+6: by toad.bitstreet.net (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: <20011025131414.A20882@abilene.com>
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
Sender: perlfect-search-admin@perlfect.com
Errors-To: perlfect-search-admin@perlfect.com
Precedence: bulk
Reply-To: perlfect-search@perlfect.com
List-Id: Perlfect Search mailing list <perlfect-search.perlfect.com>
Newsgroups: mailing-lists.perlfect
X-From: Cameron Moore <lists@toad.bitstreet.net>

Fixed another bug.  :-p

In indexer.pl, 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
perlfect-search@perlfect.com
To unsubscribe, set other personal options or view the list archives please visit: