50 lines
1.6 KiB
Diff
50 lines
1.6 KiB
Diff
From 2a06655e5c1925f09d5a2e38cd073eb1b6f069ad Mon Sep 17 00:00:00 2001
|
|
From: Michael R Sweet <michael.r.sweet@gmail.com>
|
|
Date: Tue, 15 Oct 2019 17:05:55 -0400
|
|
Subject: [PATCH] PPD files containing custom option keywords did not work
|
|
(Issue #5639)
|
|
|
|
diff --git a/cups/ppd.c b/cups/ppd.c
|
|
index fae19c42e..ff52df2e1 100644
|
|
--- a/cups/ppd.c
|
|
+++ b/cups/ppd.c
|
|
@@ -1874,9 +1874,9 @@ _ppdOpen(
|
|
{
|
|
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
|
{
|
|
- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
|
|
-
|
|
- goto error;
|
|
+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
|
+ snprintf(cname, sizeof(cname), "_%s", name);
|
|
+ strlcpy(name, cname, sizeof(name));
|
|
}
|
|
|
|
if ((size = ppdPageSize(ppd, name)) == NULL)
|
|
@@ -1903,9 +1903,9 @@ _ppdOpen(
|
|
{
|
|
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
|
{
|
|
- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
|
|
-
|
|
- goto error;
|
|
+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
|
+ snprintf(cname, sizeof(cname), "_%s", name);
|
|
+ strlcpy(name, cname, sizeof(name));
|
|
}
|
|
|
|
if ((size = ppdPageSize(ppd, name)) == NULL)
|
|
@@ -1939,9 +1939,9 @@ _ppdOpen(
|
|
|
|
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
|
{
|
|
- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
|
|
-
|
|
- goto error;
|
|
+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
|
+ snprintf(cname, sizeof(cname), "_%s", name);
|
|
+ strlcpy(name, cname, sizeof(name));
|
|
}
|
|
|
|
if (!strcmp(keyword, "PageSize"))
|