Bug 85019 - .ppd file lines with missing
Summary: .ppd file lines with missing
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: cups
Version: phoebe
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-02-24 21:57 UTC by Owen Taylor
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-02-25 17:52:17 UTC

Attachments (Terms of Use)
Offending PPD file (70.82 KB, text/plain)
2003-02-24 21:58 UTC, Owen Taylor
no flags Details
cups-1.1.17-space.patch (437 bytes, patch)
2003-02-25 17:32 UTC, Tim Waugh
no flags Details | Diff

Description Owen Taylor 2003-02-24 21:57:59 UTC
I'm going to attach a .ppd file (from one of the printers
we have around here) that cups misparses.

The .ppd spec says (page 23):

 The value is composed of printable 7-bit ASCII byte codes, possibly sepa-
 rated by spaces and tabs into multiple components. It is terminated by a 
 newline, or by a slash, in the case of a translation string.

Which isn't very clear about internal whitespace, but the
fact that HP shipped this file indicates that practically
speaking CUPS needs to strip it.

This causes gnome-print to crash because the ->defchoice 
for the PaperSize option doesn't point to one of the
defined PaperSize values for the print.

I'll work around this in gnome-print (and fix the crash) but
it would be good to get this fixed in the CUPS library as well.

Comment 1 Owen Taylor 2003-02-24 21:58:35 UTC
Created attachment 90322 [details]
Offending PPD file

Comment 2 Owen Taylor 2003-02-24 22:00:37 UTC
Since it may not be clear, the problem with this file is that

*DefaultPageSize: Letter 

Has a trailing space. (I miswrote PageSize instead of PaperSize

Comment 3 Tim Waugh 2003-02-25 17:32:52 UTC
Created attachment 90356 [details]

Is this the kind of patch you're after?  I'm not quite sure how to provoke the
gnome-print crash you see.

Comment 4 Owen Taylor 2003-02-25 17:45:19 UTC
No, I don't think that's the right field, the option would be (from

 PageSize Letter/Letter: <<asdfasdfa>>

While this is:

 DefaultPageSize: Letter 
It's a StringValue in the terminology of the .ppd spec.
It might be best to just to send this bug upstream unless you feel
comfortable with the .ppd parsing code. I've worked around it
in gnome-print now. (So, if you are using the latest gnome-print
from the tree, it won't be possible to reproduce the problem.)

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