Ticket #15 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Error in pl/nmzidx.pl within Namazu 2.0.14

Reported by: Mike Brudenell Assigned to: knok
Priority: normal Milestone:
Component: namazu-2.0 Version: 2.0
Severity: normal Keywords: commas keys files values status file
Cc:

Description

Hello,

I am still using Namazu 2.0.14 but have found a small problem in the Perl function write_status() in the pl/nmzidx.pl file.

The problem is that the write_status() function doesn't strip commas from the values it writes to the status file for the 'keys' and 'files' lines.

This means that the gcnmz script writes values with commas in back to the status file as it finishes garbage collecting. When mknmz is later used it gives a warning about doing a subtraction when one of the items contains a comma and so isn't a number.

The mknmz script already deletes commas from these values before writing them to the status file. However the gcnmz script doesn't, but uses the write_status() function ... and this doesn't check for commas either.

The patch to the Namazu 2.0.14 pl/nmzidx.pl script is simple:

*** nmzidx.pl.ORIG      Tue Jun  7 17:52:59 2005
--- nmzidx.pl   Tue May 23 16:25:22 2006
***************
*** 644,652 ****
--- 644,654 ----
  
      my $key = undef;
      $key = comma($self->{'word'}->{'size'}) if defined $self->{'word'};
+     $key =~ tr/,//d if defined $key;
  
      my $file = undef;
      $file = comma($self->{'flist'}->{'valid'}) if defined $self->{'flist'};
+     $file =~ tr/,//d if defined $file;
  
      if ($self->{'mode'} =~ /w/i){
          my $fi = &nmzlib::open_db($in, 'status');

Change History

05/25/06 14:45:54 changed by knok

  • status changed from new to closed.
  • resolution set to fixed.

This problem was already fixed in latest release. Anyway, the report will be useful for 2.0.14 users.

Thank you.