Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick the fix for #314 and push it to 1.x #328

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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