Skip to content

Commit

Permalink
PPD files containing custom option keywords did not work (Issue #5639)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 15, 2019
1 parent 692b157 commit 2a06655
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes in CUPS v2.3.1
----------------------

- Documentation updates (Issue #5661)
- PPD files containing "custom" option keywords did not work (Issue #5639)
- Added a workaround for the scheduler's systemd support (Issue #5640)
- Fixed spelling of "fold-accordion".
- Fixed the default common name for TLS certificates used by `ippeveprinter`.
Expand Down
18 changes: 9 additions & 9 deletions cups/ppd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 2a06655

Please sign in to comment.