[Lxr-commits] CVS: lxr/lib/LXR/Index Postgres.pm,1.21,1.22
Brought to you by:
ajlittoz
From: AdrianIssott <adr...@us...> - 2009-04-19 10:18:17
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8830/lib/LXR/Index Modified Files: Postgres.pm Log Message: Fix for bug 2774061 (Using PostGreSql Results in Malformed HTML in Ident Pages) * The problem was that PostGreSql return the type with an extra space on the end (which hadn't been inserted into the db) so the LXR::Index::PostGreSql now removes trailing white space from a type when returning the index for a particular symbol Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Postgres.pm 19 Apr 2009 09:51:18 -0000 1.21 +++ Postgres.pm 19 Apr 2009 10:18:00 -0000 1.22 @@ -157,20 +157,26 @@ } sub getindex { - my ($self, $symname, $release) = @_; - my ($rows, @ret); + my ($self, $symname, $release) = @_; + my ($rows, @ret); - $rows = $indexes_select->execute("$symname", "$release"); + $rows = $indexes_select->execute("$symname", "$release"); - while ($rows-- > 0) { - push(@ret, [ $indexes_select->fetchrow_array ]); - } + while ($rows-- > 0) { + my @row = $indexes_select->fetchrow_array; - $indexes_select->finish(); + $row[3] = $self->symname($row[3]); # convert the symid - map { $$_[3] &&= $self->symname($$_[3]) } @ret; + # Also need to remove trailing whitespace erroneously added by the db + # interface that isn't actually stored in the underlying db + $row[2] =~ s/^(.+?)\s+$/$1/; - return @ret; + push(@ret, \@row); + } + + $indexes_select->finish(); + + return @ret; } sub getreference { |