[l2h] dbm hash ties w/empty key?

Bruce R Miller Bruce R Miller <bruce.miller@nist.gov>
Wed, 09 Feb 2000 17:36:04 -0500


Hi Ross, Marek, et al...
  A collegue here is having a problem running latex2html on a RH6.1
alpha system because of a bug in dbm's handling of empty keys.
Apparently perl considers it OK to use an empty key, but dbm doesn't
necessarily -- and on the alpha it even crashes.

The problem occurs in l2h with tied hashes; in only one place as far
as we were able to determine:
  For starred sections(subsections,...) do_cmd_section_helper gets
called with $key undefined.  Near the end of the sub, we find

   $global{$key}-- if $making_name;

Changing it to

   $global{$key}-- if $key && $making_name;

would `fix' the problem.
--- For your consideration --- since, strictly speaking, it really
isn't a bug in l2h.  OTOH, it's not clear that it's `right' either!

Incidentally, a few lines later we noticed :

  if (! $key || $key < $MAX_SPLIT_DEPTH) { $pre = '' };

but $key is something like 'section', ...(or undefined!), NOT a number.  
Was something like this intended?

 if (! $key || $section_commands{$key} < $MAX_SPLIT_DEPTH) { $pre = ''
};


Thanks for your considerations!
--
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/