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

cupsCheckDestSupported() does not work as expected when value = NULL #5031

Closed
NilanjanaLodh opened this issue Jun 13, 2017 · 4 comments
Closed
Assignees

Comments

@NilanjanaLodh
Copy link

NilanjanaLodh commented Jun 13, 2017

CUPS version: latest snapshot of repo
The CupsPM states that

If the value argument is NULL, the cupsCheckDestSupported function returns whether the option is supported by the destination. Otherwise, the function returns whether the specified value of the option is supported.

However, this is not working as expected for me. For instance,
cupsCheckDestSupported(http, dest, dinfo, CUPS_COPIES , NULL) returns 0;
But
cupsCheckDestSupported(http, dest, dinfo, CUPS_COPIES , "1" ) returns 1.

Also, cupsFindDestSupported(http, dest, dinfo, "job-creation-attributes") lists "copies" as one of the values.

Shouldn't cupsCheckDestSupported(http, dest, dinfo, CUPS_COPIES , NULL) have returned 1 according to the CUPS PM ?
Am I missing something in the CUPS Manual?

@NilanjanaLodh NilanjanaLodh changed the title cupsCheckDestSupported() does not work as expected when *value = NULL cupsCheckDestSupported() does not work as expected when value = NULL Jun 13, 2017
@michaelrsweet michaelrsweet self-assigned this Jun 13, 2017
@michaelrsweet michaelrsweet added this to the CUPS 2.2.x Updates milestone Jun 13, 2017
@michaelrsweet
Copy link
Collaborator

Will investigate; the API should definitely work as documented.

@michaelrsweet
Copy link
Collaborator

[master 49b6c6a] The cupsCheckDestSupported function did not support NULL values (Issue #5031)

@NilanjanaLodh
Copy link
Author

I pulled the latest changes of the repo; but the problem seems to persist. 😥

@michaelrsweet
Copy link
Collaborator

Hmm, that should definitely not be the case. I've pushed a change to the "testdest" unit test program to verify this - after making CUPS the "testdest" program will be found in the "cups" directory, which can then be run with:

cups/testdest PRINTER-NAME supported copies

this works as expected with one printer I tested with:

cups/testdest Brother_MFC_J6920DW supported copies
copies (supported)
  1-9999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants