diff options
author | Karl Berry <karl@freefriends.org> | 2009-09-28 15:48:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-09-28 15:48:28 +0000 |
commit | a0d984e62eb499fe0326836ea0595b6c583fecea (patch) | |
tree | b841fb3c6b1375c6b54c04209f3e58b1f03b19e5 /Build | |
parent | b034e849abd457cdcec23fe113999316057d6f77 (diff) |
epstopdf 20071129
git-svn-id: svn://tug.org/texlive/trunk@15524 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-x | Build/source/utils/epstopdf/epstopdf.pl | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/Build/source/utils/epstopdf/epstopdf.pl b/Build/source/utils/epstopdf/epstopdf.pl index 0fb015d4420..e7ea5f239df 100755 --- a/Build/source/utils/epstopdf/epstopdf.pl +++ b/Build/source/utils/epstopdf/epstopdf.pl @@ -58,17 +58,13 @@ use strict; # * Quote OutFilename # 2005/10/01 v2.9.3draft (Gerben Wierda) # * Quote OutFilename -# 2005/10/06 v2.9.4gw (Gerben Wierda) -# * This has become the official version for now -# 2005/10/06 v2.9.5gw (Gerben Wierda) -# * Fixed a horrendous bug in the (atend) handling code # ### program identification my $program = "epstopdf"; -my $filedate="2006/01/29"; -my $fileversion="2.9.5gw"; -my $copyright = "Copyright 1998-2006 by Sebastian Rahtz et al."; +my $filedate="2003/04/20"; +my $fileversion="2.9.3draft"; +my $copyright = "Copyright 1998-2002 by Sebastian Rahtz et al."; my $title = "\U$program\E $fileversion, $filedate - $copyright\n"; ### ghostscript command name @@ -253,14 +249,13 @@ if ($buflen > 0) { # that array until it is empty, then move again back to <IN> $buf .= <IN> unless eof( IN); $buflen = length( $buf); - $bufarraypos = 0; # Some extra magic is needed here: if we set $/ to \r, Perl's re engine # still thinks eol is \n in regular expressions (not very nice) so we # cannot split on ^, but have to split on \r and reappend those. if ($/ eq "\r") { - @bufarray = split( /\r/ms, $buf); # split on \r - grep( $_ .= "\r", @bufarray); # re-append \r to each array item + @bufarray = split( /\r/ms, $buf); + grep( $_ .= "\r", @bufarray); } else { @bufarray = split( /^/ms, $buf); @@ -273,8 +268,6 @@ sub getline { $_ = shift( @bufarray); unshift( @parsedbufarray, $_); # for myseek and mytell $bufarraypos += length( $_); - # debug "getline from array. bufarraypos = $bufarraypos"; - # debug "*** READ: $_"; } else { $_ = <IN>; @@ -285,40 +278,31 @@ sub getline { ### mytell and myseek, work on <IN> only sub mytell { if ($#bufarray) { - # debug "Telling ARRAY position $bufarraypos"; return $bufarraypos; } else { - my $pos = tell( IN); - # debug "Telling FILE position $pos"; - return $pos; + return tell( IN); } } sub myseek { my $pos = shift; - # debug "Seeking to position $pos in input"; if ($pos < $buflen) { - # debug "myseek position $pos < buffer size $buflen"; # We were still parsing the array, reset to the end of buf and # move to the right line in the array. - # Now, move stuff from the @parsedbufarray back until we are back at $pos + # Now, move stuff from the @parsedbufarray until we are back at $pos my $tmpline; - while ($bufarraypos > $pos) { - # debug "myseek bufarray position $bufarraypos > position $pos"; + while ($pos > 0) { # we test on parsedbufarray to prevent an infinite loop on # a programming error (DEVELOP only) die "Programming error 1\n" unless $#parsedbufarray; - $tmpline = shift( @parsedbufarray); - $bufarraypos -= length( $tmpline); - unshift( @bufarray, $tmpline); - debug "*** UNREAD: $tmpline"; + $tmpline = pop( @parsedbufarray); + $pos -= length( $tmpline); + push( @bufarray, $tmpline); } - # debug "Returning to ARRAY size position $buflen (bufarraypos = $bufarraypos)"; return seek( IN, $buflen, 0); } else { - # debug "Seeking to FILE position $pos"; return seek( IN, $pos, 0); } } |