Skip to content

Commit c13b98d

Browse files
committed
[css2] Arnaud bug fix
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401753
1 parent 49fdd26 commit c13b98d

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

css2/bin/html2ps

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ eval 'exec perl -S $0 "$@"'
1818
#
1919

2020
#
21-
# This is html2ps version 1.0 beta1, an HTML-to-PostScript converter.
21+
# This is html2ps version 1.0 beta2, an HTML-to-PostScript converter.
2222
# Copyright (C) 1995-1997 Jan Karrman.
2323
#
2424
# This program is free software; you can redistribute it and/or modify
@@ -386,7 +386,7 @@ $space=join('|',keys %space);
386386
"archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14,
387387
"11x17",27.9, "ledger",43.2);
388388

389-
$version="html2ps version 1.0 beta1 patched by Arnaud Le Hors";
389+
$version="html2ps version 1.0 beta2 patched by Arnaud Le Hors 19990806";
390390
$opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|T|u|U|v|W:|"
391391
."x:";
392392
%optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d',
@@ -3860,12 +3860,8 @@ sub DSC {
38603860
last S;
38613861
}
38623862
if($line=~/^\[(.*) (\d+) $io\]$/) {
3863-
# $li=$BM[$2]=~y/\n/\n/+2;
3864-
# the above Arnaud's line; this is the old:
38653863
$li=$BM[$ix[$2]]=~y/\n/\n/+2;
38663864
$line="\/picstr $WS[$ix[$2]] string D\n$1\n"
3867-
# ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$2]\n%%EndData";
3868-
# The above is Arnaud's line, this is the old:
38693865
."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData";
38703866
last S;
38713867
}
@@ -3998,8 +3994,19 @@ sub ref {
39983994
open(TMP, "<$scr.out.bak");
39993995
open(OUTPUT, ">$scr.out");
40003996
while (<TMP>) {
4001-
s|/HN [^D]*D|/HN [$pnum] D|;
3997+
if (/^\/HN /) {
3998+
# load the whole block of lines up to the end
3999+
$buf = $_;
4000+
while (!/[^D]*D$/) {
4001+
$_ = <TMP>;
4002+
$buf .= $_;
4003+
}
4004+
# update it now
4005+
$buf =~ s|/HN [^D]*D|/HN [$pnum] D|;
4006+
print OUTPUT $buf;
4007+
} else {
40024008
print OUTPUT $_;
4009+
}
40034010
}
40044011
close(TMP);
40054012
close(OUTPUT);

0 commit comments

Comments
 (0)