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

Skip to content

Commit bb7775a

Browse files
committed
Fix SF bug #479967: Appearantly I broke something that made the index
insertion work. This fix makes things at least somewhat more explicit, and adds a little sanity checking (and verbosity!) to add_bbl_and_idx_dummy_commands().
1 parent 97e3201 commit bb7775a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Doc/perl/l2hinit.perl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ sub add_bbl_and_idx_dummy_commands {
497497
if (scalar(@parts) == 3) {
498498
# Be careful to re-write the string in place, since $_ is *not*
499499
# returned explicity; *** nasty side-effect dependency! ***
500+
print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
500501
print "\nadd_bbl_and_idx_dummy_commands ==> adding module index";
501502
my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)"
502503
. "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
@@ -509,14 +510,21 @@ sub add_bbl_and_idx_dummy_commands {
509510
$HAVE_GENERAL_INDEX = 1;
510511
}
511512
elsif (scalar(@parts) == 2) {
513+
print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
514+
my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
515+
s/$rx/\\textohtmlindex \1/o;
512516
$HAVE_GENERAL_INDEX = 1;
513517
}
514-
else {
518+
elsif (scalar(@parts) == 1) {
519+
print "\nadd_bbl_and_idx_dummy_commands ==> no index found";
515520
$CUSTOM_BUTTONS .= get_my_icon('blank');
516521
$global{'max_id'} = $id; # not sure why....
517522
s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
518523
s/[\\]printindex/\\textohtmlindex /o;
519-
}
524+
}
525+
else {
526+
die "\n\nBad number of index environments!\n\n";
527+
}
520528
#----------------------------------------------------------------------
521529
lib_add_bbl_and_idx_dummy_commands()
522530
if defined(&lib_add_bbl_and_idx_dummy_commands);

0 commit comments

Comments
 (0)