Skip to content

Commit

Permalink
Fix default 'copies' value for papplJobCreateWithFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 30, 2023
1 parent 49f9a0c commit 3d962e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Changes in v2.0b1
- Fixed potential deadlock issue (Issue #297)
- Fixed loading of previous state (Issue #298)
- Fixed "printer-id" value for new printers (Issue #301)
- Fixed default "copies" value with `papplJobCreateWithFile`.
3 changes: 1 addition & 2 deletions pappl/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ _papplJobCreate(
job->state = IPP_JSTATE_HELD;
job->system = printer->system;
job->created = time(NULL);
job->copies = 1;

if (attrs)
{
Expand All @@ -118,8 +119,6 @@ _papplJobCreate(

if ((attr = ippFindAttribute(job->attrs, "copies", IPP_TAG_INTEGER)) != NULL)
job->copies = ippGetInteger(attr, 0);
else
job->copies = 1;

hold_until = ippGetString(ippFindAttribute(attrs, "job-hold-until", IPP_TAG_KEYWORD), 0, NULL);
hold_until_time = ippDateToTime(ippGetDate(ippFindAttribute(attrs, "job-hold-until-time", IPP_TAG_DATE), 0));
Expand Down

0 comments on commit 3d962e7

Please sign in to comment.