diff options
author | Fred Drake <fdrake@acm.org> | 1998-05-11 18:23:35 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-05-11 18:23:35 (GMT) |
commit | 41814bc51fbadc5b6fa962323157343b6efc42b6 (patch) | |
tree | 98d7d5bfa0fe97cb9665a1c2fb7e602cd08ab521 /Doc/perl/l2hinit.perl | |
parent | 099b76c3bd6b3a94ad94d65bb2d7a6cf4d1f062a (diff) | |
download | cpython-41814bc51fbadc5b6fa962323157343b6efc42b6.zip cpython-41814bc51fbadc5b6fa962323157343b6efc42b6.tar.gz cpython-41814bc51fbadc5b6fa962323157343b6efc42b6.tar.bz2 |
In package Override, use the getcwd() function from the Cwd module instead of
the one from Override.pm (part of latex2html).
Absolutize the TEXINPUTS environment variable, since we can't count on
latex2html doing it for us (even though I sent in a patch, and it really
should).
Diffstat (limited to 'Doc/perl/l2hinit.perl')
-rw-r--r-- | Doc/perl/l2hinit.perl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/perl/l2hinit.perl b/Doc/perl/l2hinit.perl index 3841036..0085152 100644 --- a/Doc/perl/l2hinit.perl +++ b/Doc/perl/l2hinit.perl @@ -6,6 +6,13 @@ # New name to avoid distributing "dot" files with the Python documentation. # +package Override; + +use Cwd qw(getcwd); + + +package main; + $INFO = 1; # 0 = do not make a "About this document..." section $MAX_LINK_DEPTH = 3; $ADDRESS = ''; @@ -24,6 +31,21 @@ $VERBOSITY = 0; $TEXINPUTS = ''; # avoid bogus l2h setting it to ':' !!! +sub absolutize_path{ + my $path = @_[0]; + my $npath = ''; + foreach $dir (split $envkey, $path) { + $npath .= make_directory_absolute($dir) . $envkey; + } + $npath =~ s/$envkey$//; + $npath; +} +# This is done because latex2html doesn't do this for us, but does change the +# directory out from under us. +if (defined $ENV{'TEXINPUTS'}) { + $ENV{'TEXINPUTS'} = absolutize_path($ENV{'TEXINPUTS'}); +} + # Locate a file that's been "require"d. Assumes that the file name of interest # is unique within the set of loaded files, after directory names have been # stripped. Only the directory is returned. |