This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 97763 - mpage-2.5.3-4 produces junk (problem in UTF-8 patch)
mpage-2.5.3-4 produces junk (problem in UTF-8 patch)
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: mpage (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-20 12:24 EDT by Need Real Name
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version: 2.5.3-6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-23 12:57:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-06-20 12:24:18 EDT
I have a 25-page postscript file (available gzipped at
<http://www.inference.phy.cam.ac.uk/sanjoy/mpage/dimensional-analysis.ps.gz>
that mpage-2.5.3-4 doesn't process right.  It produces a postscript
file with 0 pages.  The vanilla mpage-2.5.3 works fine (I built it
from the .tar.gz file using just 'make' and all the defaults).  I then
applied one patch at a time from the 2.5.3-4 SRPM.  The only patch
that made it break was mpage-2.5.3-utf8.patch

The cmd line that breaks mpage:

% ./mpage -b letter -2o < dimensional-analysis.ps

whereas if I don't use stdin, it works fine:

./mpage -b letter -2o dimensional-analysis.ps

I'm using a Pentium Linux (RH 7.3) system (I built the 2.5.3-4 RPM
from the rawhide SRPM and found the problem originally, then tracked
down the individual patches).

A minor change is that the spec file says the license is BSD but the
COPYING file is GPL v2.

-Sanjoy

Here's a bit more details of what breaks and the command sequence:

% printenv MPAGE     /* to show that MPAGE is unset */
% rm -fr mpage-2.5.3
% tar xzf mpage-2.5.3.tgz /* reinstall clean sources */
% cd mpage-2.5.3
% make
[compiles with no problem]
% ./mpage -b letter -2o < dimensional-analysis.ps | grep Pages
%%Pages: (atend)
%%%Pages: 25
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 13
[Like it should be -- 25 pages originally, now 13 2-up pages]

[Now I apply the utf8 patch:]
% patch -p1 < /usr/src/redhat/SOURCES/mpage-2.5.3-utf8.patch
patching file file.c
patching file glob.c
patching file mpage.c
patching file mpage.h
patching file text.c

% make
[All compiles fine except for the warning below:]
gcc -O2 -s -DPAGE_DEF=\"A4\" -DLIBDIR=\"/usr/local/share/mpage\" -DDEFAULT_ENCO
DING=1 -DDEFAULT_DUPLEX=0 -DDEFAULTSMARGIN=18  -DSPOOLER=BSD_SPOOLER  -Wall -c 
-o file.o file.c
file.c: In function `looks_utf8':
file.c:547: warning: array subscript has type `char'

[Now retry mpage:]
% ./mpage -b letter -2o < dimensional-analysis.ps | grep Pages
%%Pages: (atend)
%%Pages: 0
[Ack!  0 pages in the resulting file!]

[And with cmd line input instead of stdin]
% ./mpage -b letter -2o dimensional-analysis.ps | grep Pages
%%Pages: (atend)
%%%Pages: 25
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 1
%%Pages: 13
[If I use the cmd line instead of stdin, no problem.]

Note You need to log in before you can comment on or make changes to this bug.