After my recent complaint about l2h not finding the aux files when
using an appearantly complex directory structure, Ross pointed me to
the 98.1p3 release.  That still didn't solve the problem, so I dug in
a little deeper and have a new patch (to 98.1p3 this time) that also
address Ross's concern that I was using $ENV{'TEXINPUTS'} instead of
$TEXINPUTS (now I just use $TEXINPUTS instead ;).
  What the patch does is force $TEXINPUTS to contain only absolute
path names after initialization, making it safe around the directory
changes performed internally by l2h.  In making this change, I found
that make_directory_absolute() wasn't working; it always returned the
directory l2h was started from.  Since it was using a subshell to run
pwd, I think what was happening is that the subshell was being run from
the starting directory of l2h; I couldn't find anything in the camel
book about this behavior of the backtick operator, though.  To deal
with this, I changed the definition of getcwd() in Override.pm by
importing it from the Cwd module ("use Cwd;") instead.  The catch is,
I can't test to see if this works on non-Unix platforms.  Can someone
check this?
  I've attached the patch below.  I sent it to Ross already, but he's
appearantly busy with other things (no, I'm not complaining!).  Please 
let me know if there are any problems with the patch or if there are
reasons not to do this.


  -Fred

--
Fred L. Drake, Jr.
[EMAIL PROTECTED]
Corporation for National Research Initiatives
1895 Preston White Drive    Reston, VA  20191


*** latex2html  1998/04/29 15:49:15     1.1
--- latex2html  1998/04/29 16:20:57
***************
*** 1201,1206 ****
--- 1201,1212 ----
        unless ($ENV{'TEXINPUTS'} || &find_executable('kpsewhich'));
      $ENV{'TEXINPUTS'} = join($envkey,".",@_,$ENV{'TEXINPUTS'});
      $TEXINPUTS = $ENV{'TEXINPUTS'} unless ($TEXINPUTS);
+     my $absinputs = '';
+     foreach $path (split $envkey, $TEXINPUTS) {
+       $absinputs .= make_directory_absolute($path) . "$npath$envkey";
+     }
+     $absinputs =~ s/$envkey$//;
+     $TEXINPUTS = $absinputs;
  }
  
  sub add_document_info_page {
*** Override.pm 1998/04/29 16:18:37     1.1
--- Override.pm 1998/04/29 16:30:46
***************
*** 182,200 ****
      $path;
  }
  
! sub getcwd {
!     local($_);
!     if ($OS =~ 'MSWin32') {
!        $_ = Win32::GetCwd();
!        $_ =~ s/\\/${dd}/g;
!     } else {
!        $_  = `pwd`;
!        die "'pwd' failed (out of memory?)\n"
!            unless length;
!        chop;
!     }
!     $_;
! }
  
  sub syswait {
      local($_) = @_;
--- 182,188 ----
      $path;
  }
  
! use Cwd;
  
  sub syswait {
      local($_) = @_;

Reply via email to