You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
cupstestppd does not report bad *JobPatchFile PPD syntax #3421
cupstestppd liked the syntax, but what pstops actually put into
the file was:
0: /setpacking { pop //false setpacking } bind def
which of course incurs a PostScript undefined. Apparently pstops
doesn't parse the *JobPatchFile syntax into a separate int and
invocation string. (Probably treating it like *PatchFile, which
doesn't have the extra int argument.)
I was able to work around the problem by writing deliberately
incorrect syntax leaving off the int:
*JobPatchFile: "/setpacking { pop //false setpacking } bind def "
cupstestppd still likes it, and now pstops puts the right string
into the file. But it would be nice if the correct syntax worked
too.
it does work. (It goes in the file with %%BeginFeature: *JobPatchFile 1
instead of 0, but it works, which is the part I really cared about.)
Should my second wrong attempt, where I left the int completely off, maybe have been dinged by cupstestppd? I.e., am I right that the int being syntactically OptionKeyword doesn't make it optional in the sense of not having to be there, and that the following nonterminal, InvocationValue, can only occur "where there is an option keyword present"? That's a tiny point though.
Hmm, there is a check in cupstestppd to make sure we don't have a double-quote in the string (which would indicate a malformed JobPatchFile value). Doing some more testing...
Activity
michaelrsweet commentedon Nov 19, 2009
CUPS.org User: mike
Actually, look closer: there is no colon after JobPatchFile, and the description specifies that the int is an OptionKeyword.
michaelrsweet commentedon Nov 19, 2009
CUPS.org User: chap
I'll get my glasses checked, those colons are harder and harder to see.
Unforced error on my part, sorry. If I use
*JobPatchFile 0: "/setpacking { pop //false setpacking } bind def "
it does work. (It goes in the file with %%BeginFeature: *JobPatchFile 1
instead of 0, but it works, which is the part I really cared about.)
Should my second wrong attempt, where I left the int completely off, maybe have been dinged by cupstestppd? I.e., am I right that the int being syntactically OptionKeyword doesn't make it optional in the sense of not having to be there, and that the following nonterminal, InvocationValue, can only occur "where there is an option keyword present"? That's a tiny point though.
Sorry for my hasty conclusion yesterday.
-Chap
michaelrsweet commentedon Nov 19, 2009
CUPS.org User: mike
Reopening as a bug against cupstestppd then...
michaelrsweet commentedon Nov 20, 2009
CUPS.org User: mike
Hmm, there is a check in cupstestppd to make sure we don't have a double-quote in the string (which would indicate a malformed JobPatchFile value). Doing some more testing...
michaelrsweet commentedon Nov 20, 2009
CUPS.org User: mike
Fixed in Subversion repository.
Turns out the check in cupstestppd was not enough; I've added checks in ppdOpen* for this instead.
michaelrsweet commentedon Nov 20, 2009
"str3421.patch":
Index: cups/test.ppd
--- cups/test.ppd (revision 8897)
+++ cups/test.ppd (working copy)
@@ -39,7 +39,7 @@
_Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-_cupsFilter: "application/vnd.cups-raster - 0"
+*cupsFilter: "application/vnd.cups-raster 0 -"
*RequiresPageRegion All: True
*% These constraints are used to test ppdConflicts() and cupsResolveConflicts()
Index: cups/ppd.c
--- cups/ppd.c (revision 8897)
+++ cups/ppd.c (working copy)
@@ -352,11 +352,13 @@
_("Illegal option keyword string"),
_("Illegal translation string"),
_("Illegal whitespace character"),
return (_cupsLangString(cupsLangDefault(), _("Unknown")));
else
return (_cupsLangString(cupsLangDefault(), messages[status]));
@@ -1177,6 +1179,37 @@
}
else if (!strcmp(keyword, "JobPatchFile"))
{
ppd->patches = strdup(string);
else
Index: cups/ppd.h
===================================================================
--- cups/ppd.h (revision 8897)
+++ cups/ppd.h (working copy)
@@ -115,7 +115,10 @@
PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string /
PPD_ILLEGAL_TRANSLATION, / Illegal translation string /
PPD_ILLEGAL_WHITESPACE, / Illegal whitespace character */
} ppd_status_t;
enum ppd_conform_e /**** Conformance Levels @SInCE CUPS 1.1.19/Mac OS X 10.3@ ****/