Skip to content

Commit

Permalink
Cherry-pick the fix for OpenPrinting#314 and push it to 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Dec 7, 2020
1 parent 39e1647 commit 32bfedf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ CHANGES IN V1.28.7
- libcupsfilters: Fixed addition of grayscale mode in
generated PPD files, to avoid duplicate entries
(OpenPrinting CUPS issue #59).
- libcupsfilters: Added NULL check when removing ".Borderless"
suffixes from page size names (Issue #314).

CHANGES IN V1.28.6

Expand Down
12 changes: 8 additions & 4 deletions cupsfilters/ppdgenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */

if (all_borderless) {
suffix = strcasestr(ppdname, ".Borderless");
*suffix = '\0';
if (suffix)
*suffix = '\0';
}

cupsFilePrintf(fp, "*OpenUI *PageSize/%s: PickOne\n"
Expand Down Expand Up @@ -2260,7 +2261,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */

if (all_borderless) {
suffix = strcasestr(ppdsizename, ".Borderless");
*suffix = '\0';
if (suffix)
*suffix = '\0';
}

cupsFilePrintf(fp, "*PageSize %s%s%s%s: \"<</PageSize[%s %s]>>setpagedevice\"\n",
Expand Down Expand Up @@ -2304,7 +2306,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */

if (all_borderless) {
suffix = strcasestr(ppdsizename, ".Borderless");
*suffix = '\0';
if (suffix)
*suffix = '\0';
}

cupsFilePrintf(fp, "*PageRegion %s%s%s%s: \"<</PageSize[%s %s]>>setpagedevice\"\n",
Expand Down Expand Up @@ -2340,7 +2343,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */

if (all_borderless) {
suffix = strcasestr(ppdsizename, ".Borderless");
*suffix = '\0';
if (suffix)
*suffix = '\0';
}

cupsFilePrintf(fp, "*ImageableArea %s: \"%s %s %s %s\"\n", ppdsizename,
Expand Down

0 comments on commit 32bfedf

Please sign in to comment.