Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41814bc

Browse files
committed
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).
1 parent 099b76c commit 41814bc

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Doc/perl/l2hinit.perl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
# New name to avoid distributing "dot" files with the Python documentation.
77
#
88

9+
package Override;
10+
11+
use Cwd qw(getcwd);
12+
13+
14+
package main;
15+
916
$INFO = 1; # 0 = do not make a "About this document..." section
1017
$MAX_LINK_DEPTH = 3;
1118
$ADDRESS = '';
@@ -24,6 +31,21 @@
2431
$TEXINPUTS = ''; # avoid bogus l2h setting it to ':' !!!
2532

2633

34+
sub absolutize_path{
35+
my $path = @_[0];
36+
my $npath = '';
37+
foreach $dir (split $envkey, $path) {
38+
$npath .= make_directory_absolute($dir) . $envkey;
39+
}
40+
$npath =~ s/$envkey$//;
41+
$npath;
42+
}
43+
# This is done because latex2html doesn't do this for us, but does change the
44+
# directory out from under us.
45+
if (defined $ENV{'TEXINPUTS'}) {
46+
$ENV{'TEXINPUTS'} = absolutize_path($ENV{'TEXINPUTS'});
47+
}
48+
2749
# Locate a file that's been "require"d. Assumes that the file name of interest
2850
# is unique within the set of loaded files, after directory names have been
2951
# stripped. Only the directory is returned.

0 commit comments

Comments
 (0)