Hi,
while using and browsing through latex2html v 98.1 release, I found the
following (I'm on a Linux RedHat ix86 platform):

1) When I was specifying a $TMP dir, the first system("pnmcrop ...") of
  pstoimg did fail with weird 'EOF not found' messages (but only the
  first -- all others did succeed). Playing around with 'make_tmp_dir', I
  wondered what the effect of the lines 
     open(STDOUT, ">${TMP}foo$$");
     print STDOUT &getcwd;
     close(STDOUT);
     open(FOO,"<${TMP}foo$$");
     $DESTDIR = <FOO>;
     close(FOO); unlink "${TMP}foo$$";
  is, except for kind of "messing up" STDOUT. Replacing these lines
  simply by 
     $DESTDIR = &getcwd;
  fixed my problem described above.

2) W.r.t. those remaining l2h$$ directories (may be this is even
   connected to  (1)?), i.e. w.r.t. cleaning up $TMPDIR: I have nowhere 
   (in latex2html) found a line which attempts to unlink files in
   $TMPDIR, or which removes $TMPDIR. Adding the lines:
    # clean up $TMPDIR, as well
    if (opendir(DIR, "$TMPDIR")) {
        local(@files) = readdir(DIR);
        foreach (@files) { unlink "$TMPDIR$dd$_" }
        closedir (DIR);
        &write_warnings("\n\n Couldn't remove  $TMPDIR : $!")
            unless (rmdir "$TMPDIR");
    }
  to the end of the 'cleanup' routine, solved the problem for me.

3) Inroutine open_dbm_database: Replace line
    dbmopen(%img_params, "${TMP}IMG_PARAMS",0755);
   by
    dbmopen(%img_params, "${TMP_}IMG_PARAMS",0755);
   otherwise IMG_PARAMS is in cwd, and never removed.

4) The 'cp' routine is not foolproof: If $src and $dest are the same
   files, then cp deletes content of $src. I suggest to add the
   following lines, befor $src and $dest are opened:
    local($sdev, $sino, $ddev, $dino);
    ($sdev, $sino) = stat($src);
    ($ddev, $dino) = stat($dest);
    return if ($sdev == $ddev && $sino == $dino);
   This should take care of it, as far as I can see -- don't know
   whether is cross-platform compatible, though.

Olaf

Reply via email to